Created attachment 361 [details]
Test for sparse matrix range check
There is no range check for sparse matrices:
For a standard SparseMatrix<double, Dynamic> (row major format?), elements above the upper column limit can be inserted, e.g. an element in column 11 in a 10 x 10 sparse matrix. There is no error or exception thrown.
Inserting an entry above the row limit usually leads to a segmentation fault.
Both behaviors are demonstrated in the example code attached.
Indeed, this is not checked.
Another thing: Dynamic should not be a allowed as template parameter. Sparse matrices are always dynamic sized.
Only valid options at the moment are ColMajor (default) and RowMajor.
Both fixed for both matrices and vectors:
Date: 2013-06-28 15:56:43
Summary: Bug 626: add compiletime check of the Options template parameter of SparseMatrix and SparseVector. Fix eval and plain_object for sparse objects.
Date: 2013-06-28 16:16:02
Summary: Fix bug 626: add assertion on input ranges for coeff* and insert members for sparse objects
*** Bug 641 has been marked as a duplicate of this bug. ***