Constructing a Eigen::SparseMatrix<Real, Eigen::RowMajor, short> and then attempting to call diagonal() on the result fails: /opt/apps/ossw/libraries/eigen/eigen-3.1.3/include/eigen3/Eigen/src/Core/Diagonal.h:77: error: call of overloaded 'min(short int, int)' is ambiguous The arithmetic on rows()+/-value() at that line promotes the results from short to int, which is then (on a typical system) different from and not std::min comparable with short. The same error appears to exist in 3.1.91 (mercurial changeset ab987ecbac8c), the newest version I could find, at line 78.
I meant to mark this as the lowest importance; anyone who isn't starved for RAM can work around the bug by just using int as their index type.
cannot reproduce with: #include <Eigen/Sparse> int main(){ Eigen::SparseMatrix<double, Eigen::RowMajor, short> m(10,10); m.diagonal(); return 0; } Tested with various versions of gcc, clang and Eigen.
Hmmm... I can't reproduce the error with that test either, and I can't see any reason why not. I'm double-checking to make sure the environment I'm currently using still fails in my full code; assuming it does then I'll try to distill that into a short enough test case to post.
The error (if it is a library error) only seems to trigger when I try to assign the diagonal: #include <Eigen/Sparse> int main(){ Eigen::SparseMatrix<double, Eigen::RowMajor, short> m(10,10); Eigen::Matrix<double, Eigen::Dynamic, 1> v(10); v = m.diagonal(); return 0; }
(In reply to comment #2) > cannot reproduce with: > > #include <Eigen/Sparse> > int main(){ > Eigen::SparseMatrix<double, Eigen::RowMajor, short> m(10,10); > m.diagonal(); > return 0; > } If you call the offending rows-method, you'll get the reported (or similar) error: > m.diagonal().rows();
https://bitbucket.org/eigen/eigen/commits/f69804538dde/ Changeset: f69804538dde User: ggael Date: 2013-06-10 10:11:29 Summary: Fix bug 605: ambiguous call to std::min when calling .diagonal() on a sparse matrix with non default index type
-- 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/605.