Bug 478 - Eigenvalue calculation does not converge on all-zeros matrix
Eigenvalue calculation does not converge on all-zeros matrix
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: Eigenvalues
3.1
All All
: Normal Unknown
Assigned To: Nobody
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-19 15:34 UTC by Joris Mooij
Modified: 2012-06-20 10:12 UTC (History)
3 users (show)



Attachments

Description Joris Mooij 2012-06-19 15:34:06 UTC
Calculating eigenvalues of an all-zero matrix and querying the info() method yields NoConvergence.

Progam to reproduce the bug (on Debian testing):

---
#include <eigen3/Eigen/Dense>
#include <iostream>

using namespace std;
using Eigen::MatrixXd;
using Eigen::EigenSolver;

int main() {
    size_t size = 5;
    MatrixXd allzeros(size,size);
    allzeros = MatrixXd::Zero(size,size);
    EigenSolver<MatrixXd> eigensolver(allzeros);
    if( eigensolver.info() != Eigen::Success )
        cerr << "Eigenvalue calculation not successful (error code " << eigensolver.info() << ")" << endl;
    cout << eigensolver.eigenvalues() << endl;
}
---

Output:
---
Eigenvalue calculation not successful (error code 2)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
---
Comment 1 Gael Guennebaud 2012-06-20 10:12:20 UTC
Thanks for the report.

https://bitbucket.org/eigen/eigen/changeset/0c1b3329762c/
changeset:   0c1b3329762c
user:        ggael
date:        2012-06-20 10:08:32
summary:     fix bug 478: RealSchur failed on a zero matrix.

https://bitbucket.org/eigen/eigen/changeset/e31c45aff2a5/
changeset:   e31c45aff2a5
branch:      3.0
user:        ggael
date:        2012-06-20 10:08:32
summary:     fix bug 478: RealSchur failed on a zero matrix.
(transplanted from 0c1b3329762c1c7c709282004bae9a2ddda12c07)

Note You need to log in before you can comment on or make changes to this bug.