New user self-registration is currently disabled. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Bug 843 - SVD for a certain complex matrix gives wrong singular values / decomposition
SVD for a certain complex matrix gives wrong singular values / decomposition
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: SVD
3.2
x86 - general Windows
: Normal Wrong Result
Assigned To: Nobody
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-16 18:08 UTC by Michael Scherbela
Modified: 2014-07-17 17:16 UTC (History)
3 users (show)



Attachments
Short c++ code that reproduces the error using the matrix loaded from a given .csv file (1.21 KB, application/octet-stream)
2014-07-16 18:08 UTC, Michael Scherbela
no flags Details

Description Michael Scherbela 2014-07-16 18:08:43 UTC
Created attachment 478 [details]
Short c++ code that reproduces the error using the matrix loaded from a given .csv file

Using a 4x4 complex matrix, of which most entries are close to 0, the SVD gives incorrect results.

1.) The singular values differ from python numpy library
2.) Calculating U * diag(S) * V.adjoint() does not give the original A

If the values that are "close to 0" are set exactly to 0, the code works (see attached example)

When the code fails, the biggest returned singular value is the second biggest singular value.

Whishing you all the best!
Comment 1 Gael Guennebaud 2014-07-17 17:16:21 UTC
Thanks for the report.

https://bitbucket.org/eigen/eigen/commits/93c0950aad3b/
Changeset:   93c0950aad3b
User:        ggael
Date:        2014-07-17 17:09:15
Summary:     Bug 843: fix jacobisvd for complexes and extend respective unit test to chack with random tricky matrices

https://bitbucket.org/eigen/eigen/commits/50066353b7ac/
Changeset:   50066353b7ac
Branch:      3.2
User:        ggael
Date:        2014-07-17 17:09:15
Summary:     Bug 843: fix jacobisvd for complexes and extend respective unit test to chack with random tricky matrices,
and backport other JacobiSVD fixes

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