Summary: | Wrong Index type of Eigen::SparseMatrix | ||
---|---|---|---|
Product: | Eigen | Reporter: | citibeth <rpf2116> |
Component: | Sparse | Assignee: | Nobody <eigen.nobody> |
Status: | RESOLVED FIXED | ||
Severity: | Documentation | CC: | chtz, gael.guennebaud |
Priority: | Normal | ||
Version: | 3.3 (current stable) | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
citibeth
2016-12-31 15:57:33 UTC
This is different from the behavior of Eigen 3.2.10, which works according to the documentation. Starting from Eigen 3.3 you should use SparseMatrix<...>::StorageIndex. SparseMatrix<...>::Index is an alias for Eigen::Index (which is ptr_diff_t by default) and should usually not be used. Can you link to where you found typename Eigen::SparseMatrix<double,0,int>::Index in the documentation, so that this can be fixed? See here: https://eigen.tuxfamily.org/dox/classEigen_1_1SparseMatrix.htm The docs don't tell you explicitly to use `SparseMatrix<...>::Index`. But they're unfortunately sparse (no pun intended); one then infers the use of `SparseMatrix<...>::Index` based on the name and description of the `_Index` argument to the `SparseMatrix` template. I would suggest the following two courses of action: 1. Rename the `_Index` template argument to `_SparseIndex`. 2. Add an explanation in the docs of which typedefs inside `SparseMatrix<..>` should be used by the user, and what for. For the record, this issue was mentioned in the release summary: http://eigen.tuxfamily.org/index.php?title=3.3#Index_typedef but since there are so many novelties, it's easy to miss it, and we should reproduce it in the SparseMatrix doc. (In reply to citibeth from comment #3) > See here: > > https://eigen.tuxfamily.org/dox/classEigen_1_1SparseMatrix.htm > > The docs don't tell you explicitly to use `SparseMatrix<...>::Index`. But > they're unfortunately sparse (no pun intended); You're not the first doing that one ;) > one then infers the use of > `SparseMatrix<...>::Index` based on the name and description of the `_Index` > argument to the `SparseMatrix` template. ah, that's bad indeed. I really thought it was already renamed "_StorageIndex", as everywhere else (hopefully). https://bitbucket.org/eigen/eigen/commits/aa7dbdf1cebe/ Summary: Bug 1370: rename _Index to _StorageIndex in SparseMatrix, and add a warning in the doc regarding the 3.2 to 3.3 change of SparseMatrix::Index https://bitbucket.org/eigen/eigen/commits/5fb2cc115cce/ Summary: Bug 1370: add doc for StorageIndex -- 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/1370. |