Why does GMatrix give a MismatchedSizeException when a multiplication requires the
size of original matrix (number of columns) to changed?
Example:
GMatrix test = new GMatrix (5, 2);
for (int i=0; i<5; i++)
for (int j=0; j<2; j++)
test.setElement(i, j, i*5+j);
GMatrix test2 = new GMatrix (2,4);
for (int i=0; i<2; i++)
for (int j=0; j<4; j++)
test2.setElement(i, j, i*2+j);
test.mul(test2);
gives:
Exception in thread "main" javax.vecmath.MismatchedSizeException: GMatrix.mul:array
dimension mismatch
at javax.vecmath.GMatrix.mul(GMatrix.java:124)
However, if you set up the new GMatrix first, it works fine.
GMatrix test3 = new GMatrix (5,4);
test3.mul(test,test2);
So, its not a problem with the multiplication, just with the resizing. (Same thing
happens when the matrix gets smaller due to multiplication.)
Transposing a non-square matrix in place requires resizing and that works, so why not
multiplication? If its just not supported, I suggest the restrition be mentioned in
the JavaDocs.
Thanks for any information-
Alan
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".