Registered Member
|
I have a problem of get a scalar ,such as a single number not like the form of <1,0> ,from eigenvalue when I use function eigenvalues(). As I am learning use Eigen ,not found a solutioin to that problem. Could you help me to deal with it?
|
Registered Member
|
I am not sure I understand what you are saying, but I think the issue is that eigenvalues() returns the eigenvalues as complex numbers. To get the real part, you can do xxx.real() .
|
Registered Member
|
Thank you very much! The real part is what I want get from the complex numbers. My expression was not exactly clear. here I have other question that why doesn't it return a real number instead of complex numbers. |
Moderator
|
unless your matrix is symmetric or has a special structure, for a general real matrix, the eigenvalues are complex. If your matrix is symmetric, then use SelfAdjointEigenSolver instead of EigenSolver.
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot]