Created attachment 955 [details] Package of code, build script (under Visual Studio Developer Command Prompt), and built x64 binaries The following code fails on VS 2017/2019, Eigen 3.3.7/TIP (323c052e1731/70e55a287bfe), x86/x64 Expected behavior: exit without showing anything. Actual behavior: Assertion failed: it.row() < xm, file test_case.cc, line 17 Note: cannot reproduce on Linux. GCC works fine. #include "assert.h" #include <vector> #include <Eigen/Core> #include <Eigen/SparseCore> constexpr int K = 4; typedef Eigen::Triplet<double> Tri; void iter(const Eigen::SparseMatrix<double>& X) { int xm = X.rows(); int xn = X.cols(); for (int k = 0; k < X.outerSize(); ++k) { for (typename Eigen::SparseMatrix<double>::InnerIterator it(X, k); it; ++it) { assert(it.row() >= 0); assert(it.row() < xm); assert(it.col() >= 0); assert(it.col() < xn); } } } int main() { Eigen::SparseMatrix<double> M(K, K); std::vector<Tri> tris; tris.reserve(K); for (int i = 0; i < K; i++) tris.emplace_back(i, i, 1.0); M.setFromTriplets(tris.begin(), tris.end()); const Eigen::SparseMatrix<double> Aeq = M.diagonal().transpose().sparseView(); iter(Aeq); return 0; }
-- 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/1754.