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

how could I get 1 from <1,0>

Tags: eigenvalue eigenvalue eigenvalue
(comma "," separated)
Tang
Registered Member
Posts
4
Karma
0

how could I get 1 from <1,0>

Sat Mar 22, 2014 1:33 pm
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?
jitseniesen
Registered Member
Posts
204
Karma
2

Re: how could I get 1 from <1,0>  Topic is solved

Sat Mar 22, 2014 10:05 pm
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() .
Tang
Registered Member
Posts
4
Karma
0

Re: how could I get 1 from <1,0>

Sun Mar 23, 2014 9:46 am
jitseniesen wrote: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() .

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.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: how could I get 1 from <1,0>

Sun Mar 23, 2014 4:34 pm
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.


Bookmarks



Who is online

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