cpivot
Registered Member

Hello,
I'm try to perform the SVD of a complex matrix. For exemple, this code :
gives me this :
As you can notice, the norm of (USV*A) is not close to 0. If you change the third line of the code with A(0,0)=complex<double>(2,0); The norm is now : 3.02828e15 and the result is OK compared to matlab. I think that there is bug with SVD of a complex Matrix. Do you have an idea to solve this problem? Thank's Bye 
ggael
Moderator

You are taking the transpose of V instead of its adjoint. The correct test is:
cout << (svd.matrixU() * svd.singularValues().asDiagonal() * svd.matrixV().adjoint()  A).norm() << endl; 
Registered users: asalan, Bing [Bot], Google [Bot], Sogou [Bot]