Eigenvalues module crashes in release (or emits debug error in Debug mode) if one passes to Eigen::EigenSolver a 1x1 matrix with 1 indefinite element in it. A simple program to reproduce bug: #include <Eigen/Eigenvalues> typedef Eigen::MatrixXd EigenMatrix; int main() { EigenMatrix A(1,1); A(0,0) = std::sqrt(-1.); Eigen::EigenSolver<EigenMatrix> solver(A); EigenMatrix V(1, 1); V(0,0) = solver.eigenvectors()(0,0).real(); return 0; } The problem is in line 342 of EigenSolver.h (https://bitbucket.org/eigen/eigen/src/ec430a9cb055/Eigen/src/Eigenvalues/EigenSolver.h#cl-342): internal::isMuchSmallerThan() check returns false, and line 357 matV.col(j+1).normalize(); is executed although matV contains just 1 column. This causes assertion failure in debug and crashes program in release. Quick and dirty fix: add to line 342 second condition: || n == 1.
Thanks for the analyze of the error, though I rather added: || j+1==n Fixed there: https://bitbucket.org/eigen/eigen/changeset/d2189ba9dfd1/ changeset: d2189ba9dfd1 date: 2012-01-25 19:02:31 summary: fix bug 410: fix a possible out of range access in EigenSolver https://bitbucket.org/eigen/eigen/changeset/b8c6abb0d78a/ changeset: b8c6abb0d78a branch: 3.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/410.