Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Snippets
  • Register
  • Sign in
  • eigen eigen
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 683
    • Issues 683
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Custom issue tracker
    • Custom issue tracker
  • Merge requests 25
    • Merge requests 25
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • libeigenlibeigen
  • eigeneigen
  • Issues
  • #1062
Closed
Open
Issue created Dec 04, 2019 by Eigen Bugzilla@eigenbzReporter

SelfAdjointEigenSolver incorrect with RowMajor matrices

Submitted by tyl..@..oo.com

Assigned to Nobody

Link to original bugzilla bug (#1062)
Version: 3.2
Operating system: Linux

Description

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.

Edited Dec 05, 2019 by Eigen Bugzilla
Assignee
Assign to
Time tracking