3

I am trying to do some analytic geometry using Java after having done a lot of my work in blender and python.

After poking around a bit, I think I should be using org.apache.commons commons-math3 .

But then I tried to compute M*v and hit a roadblock. The RealMatrix class has a .multiply(RealMatrix) and a .preMultiply(RealVector), but no .multiply(RealVector) (I asked for version 3.6 in my pom.ml).

The possibilities I can think of are

  • I am missing something that should be obvious ;
  • This library is immature ;
  • I (and the rest of the blender community) are weird for doing my matrix multiplication backwards ;
  • I should be using a different library.

How do I accomplish matrix-vector postmultiplication using the comons-math3 library? Any suggestions about using a "better" library are welcome in comments, but are not answers to this question.

Tunaki
  • 132,869
  • 46
  • 340
  • 423
Mutant Bob
  • 3,121
  • 2
  • 27
  • 52
  • And how did I miss http://stackoverflow.com/questions/33275669/how-to-multiply-a-realvector-by-a-realmatrix?s=6|1.3788 ? – Mutant Bob Jan 12 '16 at 21:54

1 Answers1

10

The method you are looking for is actually called operate(v):

Returns the result of multiplying this by the vector v.

This method will multiply a RealMatrix with the given RealVector and return the resulting RealVector.

Tunaki
  • 132,869
  • 46
  • 340
  • 423