Error assigning value to matrix element with equation

I have some simple lines of code in Java using ejml Equation like this:

eq.process("T = zeros(2,3)");
eq.process("T(1,1)=10");
eq.process("T(1,0)=1");
eq.process("T(1,2)=8");

      

The last line fails, throwing the "Submatrix out of bounds. Lower bound" error. Apparently the matrix T is 2x3 and the indices start at 0, so T (1,2). I also tried to convert to original matrix like this:

DenseMatrix64F m=eq.lookupMatrix("T");
m.set(1, 2, 7);

      

And it works. Is this a bug from this library?

+3


source to share


1 answer


This is mistake. Internally, bounds checking was done with col, row instead of row, col.

There is a fix in the latest github code. You can also check the subsequent SHAs.

ec2dffbabc38c1e86f1ef58da2553cec9287b0f3

      




The questions asked on Stackoverflow are fine as more people see it. However, please report bugs and feature requests using github and the message board. They will send me a message right away, but who knows when I will see it.

+1


source







All Articles