hey there,
I'm currently trying to use the sparse matrix functionality provided by la4j. my problem now is that I typically start with empty matrices. I do know the number of columns but the number of rows is variable. As I've read over the documentation insertRow(index, double[])should be what I need, but this doesn't work for matrices with 0 rows.
final CRSMatrix crsMatrix = new CRSMatrix(0, 3);
crsMatrix.insertRow(0, SparseVector.fromArray(new double[]{0,1,2}));
This gives me Exception in thread "main" java.lang.IndexOutOfBoundsException: Illegal row number, must be 0..-1. How can I fix this?
hey there, I'm currently trying to use the sparse matrix functionality provided by la4j. my problem now is that I typically start with empty matrices. I do know the number of columns but the number of rows is variable. As I've read over the documentation
insertRow(index, double[])
should be what I need, but this doesn't work for matrices with 0 rows.This gives me
Exception in thread "main" java.lang.IndexOutOfBoundsException: Illegal row number, must be 0..-1
. How can I fix this?Cheers, Daniel