Multiply two vectors using LAPACK

Post here if you have a question about LAPACK or ScaLAPACK algorithm or data format

Multiply two vectors using LAPACK

Postby alrawi84 » Sun Nov 08, 2015 5:34 pm

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.
alrawi84
 
Posts: 3
Joined: Fri Sep 18, 2015 11:47 am

Re: Multiply two vectors using LAPACK

Postby btracey » Mon Nov 09, 2015 12:51 pm

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)
btracey
 
Posts: 11
Joined: Mon Aug 10, 2015 6:40 pm

Re: Multiply two vectors using LAPACK

Postby alrawi84 » Sun Nov 15, 2015 2:04 pm

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.
alrawi84
 
Posts: 3
Joined: Fri Sep 18, 2015 11:47 am

Re: Multiply two vectors using LAPACK

Postby btracey » Sun Nov 15, 2015 2:12 pm

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.
btracey
 
Posts: 11
Joined: Mon Aug 10, 2015 6:40 pm


Return to Algorithm / Data

Who is online

Users browsing this forum: No registered users and 2 guests

cron