Hi, The following code generates warnings about signed/unsigned comparisons: typedef Eigen::Triplet<double> T; std::vector<T> tripletList; tripletList.reserve(2); tripletList.push_back(T(0,0,7.0)); tripletList.push_back(T(0,2,1.0)); Eigen::SparseMatrix<double> matA(8,8); matA.setFromTriplets(tripletList.begin(), tripletList.end()); Warnings are at Eigen/src/SparseCore/SparseMatrix.h:951:7: Regards, Philippe
Dear Philippe, this is because Triplet by default uses unsigned int as index type. Is this on purpose? I would propose to set the default index type to int or SparseMatrix<>::index_type instead. Until that is done you can set the index type using the second template parameter, i.e. in the above test code use typedef Eigen::Triplet<double,int> T; instead. Best regards, Kolja
Fixed and back-ported to 3.2 here: https://bitbucket.org/eigen/eigen/commits/0319f4dc86d60e3916617dc1bd4ce054c112814a
-- 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/665.