New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Bug 478 - Eigenvalue calculation does not converge on all-zeros matrix
Summary: Eigenvalue calculation does not converge on all-zeros matrix
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Eigenvalues (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-19 15:34 UTC by Joris Mooij
Modified: 2017-01-31 13:55 UTC (History)
4 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)
Comment 2 Colin 2017-01-30 21:25:48 UTC
This bug seems to have reappeared in Eigen 3.3 (at least 3.3.1 and 3.3.2). 3.2.10 does not seem to reproduce this bug.

Using the exact same test code as the original bug, I now get

Output (Windows 10, Visual Studio 12):
---
Eigenvalue calculation not successful (error code 2)
(-4.8367e-026,-4.8367e-026)
(-4.8367e-026,-4.8367e-026)
(-4.8367e-026,-4.8367e-026)
(-4.8367e-026,-4.8367e-026)
(-4.8367e-026,-4.8367e-026)
---

Output (RHEL 6.6, GCC 5.2.1)
---
Eigenvalue calculation not successful (error code 2)
(0,0)
(0,0)
(0,0)
(0,0)
(0,0)
---
Comment 3 Gael Guennebaud 2017-01-31 13:55:27 UTC
Fixed with unit tests this time!

https://bitbucket.org/eigen/eigen/commits/db4fef573c20/

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