This forum has been archived. All content is frozen. Please use KDE Discuss instead.

ComplexEigenSolver eigenvalues percision

Tags: None
(comma "," separated)
steltsop
Registered Member
Posts
10
Karma
0
Hey, I am using the ComplexEigenSolver in order to calculate the eigenvalues and eigenvectors of a non-symmetric complex matrix.The eigenvalues that i get are not as precise as Matlab gives.More specifically, Matlab gives:
-3,46401798527302e+15 - 1,22954864418393e+15i
while Eigen gives:
(-3.46402e+015,-1.22955e+015)

Is it possible to increase the precision?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
It seems that only a printing precision issue. See: http://en.cppreference.com/w/cpp/io/manip/setprecision or http://eigen.tuxfamily.org/dox/structEi ... ormat.html if you' re using Eigen's facilities.
steltsop
Registered Member
Posts
10
Karma
0
You are right!! I guess it was a rookie mistake!!
Thank you for your answer :)
steltsop
Registered Member
Posts
10
Karma
0
I have another question,though.
The vector ces.eigenvalues() that contains the eigenvalues and the matrix ces.eigenvectors() create a problem to my code because the eigenvalues are sorted from the smallest value to the biggest and the equivalent eigenvectors are sorted as well.But when I slightly change my matrix I can't multiply the eigenvectors form the initial matrix and the slightly changed final matrix because maybe they are sorted a bit differently.
Is there a way to get the eigenvalues and eigenvectors without being sorted in any way?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
There is no notion of "non-ordered" eigenvalues. Actually ordering them with respect to their magnitude is still the best we can do. Tracking the eigenvalues is actually impossible.


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot]