SelfAdjointEigenSolver gives different results if used with row major or column major matrices. The differences seem to increase with the dimension of the matrix. The type also has an influence: floats give results worse than double. Complex floats are even worse. I also noted differences while using ComplexEigenSolver, but they are smaller. Here is a code sample to illustrate the problem: #include<iostream> #include "Eigen/Dense" using namespace Eigen; using namespace std; int main() { typedef float mytype ; typedef Matrix<complex<mytype>, Dynamic, Dynamic> EigMatCM; typedef Matrix<complex<mytype>, Dynamic, Dynamic, RowMajor> EigMatRM; int d = 20; EigMatCM X = EigMatCM::Random(d,d); EigMatCM A = X + X.transpose().conjugate(); SelfAdjointEigenSolver<EigMatCM> es(A); EigMatRM Xr = X; EigMatRM Ar = Xr + Xr.transpose().conjugate(); SelfAdjointEigenSolver<EigMatRM> esr(Ar); cout<<es.eigenvalues()-esr.eigenvalues()<<endl; } I compared the output to the one given by numpy.linalg.eig function, and only the row major version seems to give incorrect results.
This issue does not apply to the default branch, only the 3.2 branch is affected.
https://bitbucket.org/eigen/eigen/commits/4458e97cf524/ Branch: 3.2 Summary: Bug 1062: backport fix of SelfAdjointEigenSolver for RowMajor matrices from default branch
-- 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/1062.