Registered Member
|
I m using the ComplexEigenSolver to find the eigenvalues and the eigenvectors of a non-symmetrical matrix.
In order to check whether the result make scene I use the ces.eigenvectors() * ces.eigenvalues().asDiagonal() * ces.eigenvectors().inverse() and compare it with my matrix. I found that it is really precise for most of the values but for some values there are differences.For example, some of the values of my matrix are (0,0) but from the product of ces.eigenvectors() * ces.eigenvalues().asDiagonal() * ces.eigenvectors().inverse() I get (0.893,0.692).Also, other values of my matrix are (0.5,0) or (0.125,0) and from the product I get (0,0).I should, finally,mention that most of the values of my matrix are 10^14 or 10^13. Is there a way to improve the precision of the eigenvectors?The eigenvalues seem to be very good but it is not easy to be sure. I m sorry for asking so many questions but my results aren't correct and I have to question every single part of my code to find the mistake. |
Registered Member
|
I am not sure I understand your question. Due to the limited precision which with the computer performs floating point operations, we can expect a relative error in the eigenvectors and eigenvalues of roughly 10^-14 if we use double precision. Since your matrix has entries of 10^14 or 10^13, at least some of the eigenvalues will be similarly big. Thus, in the product ces.eigenvectors() * ces.eigenvalues().asDiagonal() * ces.eigenvectors().inverse() we should expect an error of roughly 10^-14 times (10^14 or 10^13), which corresponds to the error you report. At first sight there does not seem anything to worry about.
If you want to reduce this error, you need to do your computations with more precision. Perhaps the MPFR module can help with that; perhaps your compiler supports long double with sufficient precision. |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]