Page 1 of 1

Multiply two vectors using LAPACK

PostPosted: Sun Nov 08, 2015 5:34 pm
by alrawi84
I have two vectors to be multiplied. Both elements of vectors are complex numbers. The dimension of first one is (8*1) and the second is (6*1). I want to know if it possible to use lapack to multi these vectors.

Re: Multiply two vectors using LAPACK

PostPosted: Mon Nov 09, 2015 12:51 pm
by btracey
What are you trying to do? If you're trying to do a dot product the operation doesn't make sense. If you're trying to compute an outer product (a * b') and create a matrix of the multiplied entries, then you should use the BLAS function Ger (general rank one)

Re: Multiply two vectors using LAPACK

PostPosted: Sun Nov 15, 2015 2:04 pm
by alrawi84
btracey wrote:What are you trying to do? If you're trying to do a dot product the operation doesn't make sense. If you're trying to compute an outer product (a * b') and create a matrix of the multiplied entries, then you should use the BLAS function Ger (general rank one)


Thanks Btracey for your reply. What exactly I want to do is multiply one vector with [8 rows x 1 column] x another vector with [ 6 rows x 1 column ]. As far as I know it is not possible to do this kind of multiplication because the number of columns don't match the number of rows of second vector. Is it possible to do it by using BLAS library.

Re: Multiply two vectors using LAPACK

PostPosted: Sun Nov 15, 2015 2:12 pm
by btracey
That paritcular operation is not possible. Matrix multiplication is only defined for (m x k) x (k x n). In your case, you have (8 x 1) x (6 x1). These sizes do not match, and so the operation is not defined. Similarly, if you mean dot product, dot product is only defined for vectors of the same length. It's not possible to do what you ask, because the operation is not defined. It is possible to do x * y' (to make it (8 x 1) x (1 x 6)) if that's what you mean.