- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have need to implement the vector-matrix product (not matrix-vector product).
which function can I use?
I have tried with dgemv (with the parameter trans = 112) but it doesn't work.
I have the following matrix and vectors:
I wont compute x*M as M'*x' .
The result y is following:
I have need to implement the vector-matrix product (not matrix-vector product).
which function can I use?
I have tried with dgemv (with the parameter trans = 112) but it doesn't work.
I have the following matrix and vectors:
x = -1.2 -0.8 1.0
0 0.4 0.6
M = -0.4 0 0.4
-0.6 0 0.6
I wont compute x*M as M'*x' .
M'*v' = -0.28 -0.48 -0.44This is the code example:
double alpha = 1.0;
double beta = 0.0;
int incx = 1;
int incy = 1;
CBLAS_ORDER order = CblasRowMajor;
CBLAS_TRANSPOSE trans = CblasTrans;
int r = 3;
int c = 3;
int lda = 3;
But the result "y" is incorrect !!?
cblas_dgemv(order,trans,r,c,alpha,M,lda,x,incx,beta,y,incy);
The result y is following:
y = (-2656984258037080400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0, 94150893907688424300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0, 0.0)Help me!
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't see anything about y in your code. Remember that dgemv does the following operation:
y = alpha*A*x + beta*y.
y must be a vector. To get the values you seek, y must by zeroed.
I tried this out using sgemv (not the cblas version) and got the answers you think you should get.
If you still have problems, I will look at this anew.
Bruce
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page