2

I have a weird problem with Math.NET Numerics. Let say I have a matrix<double> well instantiated and filled (I verified by writing it in a text file), which size is (949 x 30). All I want is to remove a row from this matrix. But it seems that I can't remove all the rows I want. I can remove all the columns I want, but I just can remove the 30 first rows (maybe this is related to the number of columns which is 30). See my code :

Matrix<double> mat = getMatrixFromDico();
MessageBox.Show(mat.RowCount + " x " + mat.ColumnCount); // output is 949 x 30
mat = mat.RemoveColumn(25); // works perfectly
mat = mat.RemoveRow(25); // works perfectly
mat = mat.RemoveRow(35); // throws a System.ArgumentOutOfRangeException

Does someone have an idea what's going on ?

I think I have tested and verified everything about mat. It's really a (949 x 30) matrix and well filled with double values.

Edit

I think this is the library's problem. The function might be not well implemented and works only with square matrix OR with the row/columns of the square sub-matrix of a non-square matrix.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Kabulan0lak
  • 2,116
  • 1
  • 19
  • 34

1 Answers1

2

There is indeed a bug in the argument range check in v3.0.1.
A fixed version 3.0.2 will be released shortly.

Thanks for reporting this.

Christoph Rüegg
  • 4,626
  • 1
  • 20
  • 34