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

GeneralizedSelfAdjointEigenSolver v.s. lapack dsygv

Tags: None
(comma "," separated)
sumita
Registered Member
Posts
1
Karma
0
Hollo,

I wrote the C++ code with eigen to solve a Av = lBv problem,
here

    A= -0.0291673 -0.448951 -0.48359 -0.445526
    -0.448951 -0.289696 -0.445526 -0.319255
    -0.48359 -0.445526 -0.0291673 -0.448951
    -0.445526 -0.319255 -0.448951 -0.289696

    B= 0.999977 0.658283 0.491743 0.523003
    0.658283 1 0.523003 0.868399
    0.491743 0.523003 0.999977 0.658283
    0.523003 0.868399 0.658283 1
Then, I used GeneralizedSelfAdjointEigenSolver to get the eigenvalue "l" and eigenvector "v".
Obtained eigenvalues "l" is almost the same with the eigenvalues obtained by using lapack dsygv.
However, obtained eigenvector is different from these of lapack dsygv.

The results from GeneralizedSelfAdjointEigenSolver:
    l = -0.509984
    0.203801
    0.687355
    1.35542

    v = -0.321235 0.156434 0.753708 -1.15322
    -0.272789 1.7707 -0.679355 1.44747
    -0.321235 -0.156434 0.753708 1.15322
    -0.272789 -1.7707 -0.679355 -1.44747

The result from lapack dsygv:
    l = -0.5099767970
    0.2038101470
    0.6873309840
    1.3553507406

    v= 0.3212362790 0.3212362790 0.3212362790 0.3212362790
    0.1564368400 0.1564368400 0.1564368400 0.1564368400
    -0.7536975044 -0.7536975044 -0.7536975044 -0.7536975044
    1.1532122077 1.1532122077 1.1532122077 1.1532122077

Do anyone knows why I got the eigenvector different from the results of lapack
and how method to get the same eigenvector of lapack dsygv?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
The ones returned by lapack do not looks right as they do not satisfy v' * B * v = 1, nor Av = lBv, and they are not orthogonal.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]