Recently I compiled my program with Eigen 3.2 stable and encouterd an error as follow: error: no match for ‘operator<’ (operand types are ‘const std::_List_iterator<Eigen::Triplet<double> >’ and ‘const std::_List_iterator<Eigen::Triplet<double> >’) This is caused by comparing "begin" end "end" in function set_from_triplets in SparseMatrix.h "begin" and "end" are two iterator variable. This error is due the fact that iterator of std::list doesn't support < operation. This bug was introduced by the 9e8ce09 commit for "Fix setFromTripplet with empty inputs". We know that many containers support iterator, but not all their iterators support operator<. std::list is the case. To my best knowledge, all iterators support operator!=. I think operator!= is more general to check if a container is empty. The example below can reprduce the error /////////////////////////////////// #include <iostream> #include <Eigen/Sparse> #include <list> using namespace std; int main() { Eigen::SparseMatrix<double> mat(3,3); std::list<Eigen::Triplet<double> > t; t.push_back( Eigen::Triplet<double>(0,0,1) ); mat.setFromTriplets(t.begin(),t.end()); return 0; } //////////////////////////////// I compiled my code under linux Mint 64bit with gcc 4.8.1.
Fixed and backported to 3.2 here: https://bitbucket.org/eigen/eigen/commits/961ac1984b0fd685bb9becc18674008897562d28
-- 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/664.