Summary: | No range check for sparse matrix | ||||||
---|---|---|---|---|---|---|---|
Product: | Eigen | Reporter: | Kolja Brix <brix> | ||||
Component: | Sparse | Assignee: | Nobody <eigen.nobody> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Unknown | CC: | alexander.werner, chtz, gael.guennebaud | ||||
Priority: | Normal | ||||||
Version: | unspecified | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Bug Depends on: | |||||||
Bug Blocks: | 387 | ||||||
Attachments: |
|
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: https://bitbucket.org/eigen/eigen/commits/d3495e9a1994/ Changeset: d3495e9a1994 User: ggael 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. https://bitbucket.org/eigen/eigen/commits/9998c8a1b9c0/ Changeset: 9998c8a1b9c0 User: ggael 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. *** -- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/626. |
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.