SVD of a complex matrix
Wed Oct 29, 2014 12:25 pm
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.02828e-15 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?
Re: SVD of a complex matrix
Wed Oct 29, 2014 12:32 pm
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]