Registered Member
|
I am dealing with Hermitian matrices so all the eigenvalues will be real. I use EigenSolver<MatrixXd> es(Hnm) and print es.eigenvalues(). What i get from this is a list of my eigenvalues but they are printed in the form (15, 0) (27, 0), ... I need to plot these and with matrices of size of over 200 it takes me a long time to manually remove the brackets and the complex part of 0. Is there another method to display only the real eigenvalues? Sorry if this is easy to lookup but I am not experienced with coding and the resources are greek to me. Thanks.
|
Registered Member
|
Just print instead (e.g., stream)
similarly there is an imag() method for the imaginary part. The dox pages have a search feature: http://eigen.tuxfamily.org/dox/AsciiQuickReference.txt http://eigen.tuxfamily.org/dox/classEigen_1_1MatrixBase.html#accfa15407b80807dab914b1844c725e5 |
Moderator
|
Since your matrix is Hermitian, better use the SelfAdjointEigenSolver instead of the EigenSolver class.
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]