Hi,
I am starting to feel really stupid, but I can't figure out how to use BLAS to multiply a matrix by a vector... I wrote the following Fortran code:
Code:
REAL*8 X(2, 3) /1.D0, 2.D0, 3.D0, 4.D0, 5.D0, 6.D0/
REAL*8 Y(3) /2.D0, 2.D0, 2.D0/
REAL*8 Z(2)
CALL DGEMV('N', 2, 3, 1.D0, X, 2, Y, 1, 0.D0, Z, 1)
PRINT *, Z
STOP
END
DGEMV is a routine from BLAS, which should calculate Z=(0)*Z + (1)*X*Y...
Compiling the above and linking to BLAS,
Code:
g77 test.f -o3 -lblas
and then running it, produces:
Code:
7.63918485E-313 1.01855798E-312
Which is wrong since the answer should be, 18 and 24???
Any help would be much appreciated!
Bookmarks