JacobiSVD gives NaN
Submitted by zh2196
Assigned to Nobody
Link to original bugzilla bug (#1252)
Operating system: Linux
Description
Here's the code:
#############################################################
#include <iostream>
#include "../eigen-3.2.8/Eigen/Dense"
using namespace Eigen;
using namespace std;
#define cp complex<double>
int main(){
MatrixXcd m; m.resize(6,8);
m<<cp(0,-3.97691e-58), 0, 0, 0, 0, cp(0.389209,0.000989259), cp(0.766077,-3.17912e-19), 0,
0, cp(3.95428e-17,-2.70056e-20), 0, 0, 0, cp(0,-8.30225e-91), 0, cp(-0.511509,5.44428e-19),
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, cp(-2.3115e-92,-2.55599e-74), 0, 0, 0, cp(-1.62153e-93,8.30225e-91), 0, cp(9.82409e-18,-6.77259e-35),
0, 0, 0, 0, 0, 0, 0, cp(-5.26899e-94,8.30225e-91);
cout<<m<<endl;
JacobiSVD<MatrixXcd> svd(m, ComputeThinU | ComputeThinV);
cout<<svd.matrixU()<<endl<<endl;
cout<<svd.singularValues().transpose()<<endl<<endl;
cout<<svd.matrixV()<<endl<<endl;
return 0;
}
#############################################################
The matrixV is an 8x6 matrix of NaNs. The version of eigen was 3.2.8. The 2 big singular values agree with Matlab.