forum.alglib.net http://forum.alglib.net/ |
|
Column Vector vs. Row Vector http://forum.alglib.net/viewtopic.php?f=2&t=743 |
Page 1 of 1 |
Author: | chi [ Tue Dec 11, 2012 6:33 pm ] |
Post subject: | Column Vector vs. Row Vector |
I was wanting to know if ALGLIB distinguishes between row vectors and column vectors. For instance if a is a row vector b is a col vector a*b is a scalar (also the dot product) b*a is a square matrix. how would you do a computation like b*a to produce a matrix in ALGLIB? |
Author: | Sergey.Bochkanov [ Wed Dec 12, 2012 7:22 am ] |
Post subject: | Re: Column Vector vs. Row Vector |
Strictly speaking, ALGLIB works with arrays, 1-dimensional or 2-dimensional - not vectors (or matrices). It means that ALGLIB has no overloaded operators to performs calculations like "a:=b+3*c" with vectors or matrices. It concentrates on higher-lever operations, like matrix decompositions. If you want, you may use RMatrixGEMM to calculate product of two matrices - Mx1 and 1xN, but this function is optimized for large operands. It is not optimized to calculate such "thin", low-rank products, so its performance may be several times lower than that of two nested loops without any optimizations at all. |
Author: | chi [ Wed Dec 12, 2012 4:38 pm ] |
Post subject: | Re: Column Vector vs. Row Vector |
Sergey, Thanks for the reply. It seems that it will be simpler (and more efficient) to write my own outer product function for 2 vectors. Regards, |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |