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
using namespace std;
std::list<Eigen::Triplet<double> > t;
I compiled my code under linux Mint 64bit with gcc 4.8.1.
Fixed and backported to 3.2 here:
-- 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.