Reputation: 33
I would like to multiply a vector (1 x n) with a matrix (m x n) in java and the library parallel colt. I guess I have chosen it because it has parallel in its name. So you are invited to give me other nice matrix librarys in java.
But my problem is particular the vector-matrix-multiplication... I haven't found a seperate method for it on the DenseDoubleMatrix2D class? How can I do it?
Thanks!
Upvotes: 1
Views: 684
Reputation: 8346
The matrix multiplication can be done by the DoubleAlgebra
class, which has the overloaded mult
methods.
mult(DoubleMatrix1D x, DoubleMatrix1D y)
, to compute the inner product of two vectors.mult(DoubleMatrix2D x, DoubleMatrix1D y)
, for matrix-vector multiplication.mult(DoubleMatrix2D x, DoubleMatrix2D y)
, for matrix-matrix multiplication.Upvotes: 2