I wrote some code to solve the general eigenvalue problem and now I am comparing my results against LAPACK's DSPGVX function. I just worked with this example.
So I obtained the 4 auto vectors
{
{-0.0319133, -0.265466, -0.713483, 0.64765},
{-0.425628, -0.520961, -0.714215, 0.193227},
{ 0.32702, 0.565845, -0.37129, -0.659561},
{-0.682699, -0.056645, 0.0771025, 0.724409}
}
and auto values
{-2.22545, 1.12704, -0.454756, 0.100076}
both with my code and with Mathematica and results agree.
But in the previous link, auto vectors reported from LAPACK are completely different.
Eigenvalues
-0.4548 0.1001
Selected eigenvectors
1 2
1 0.3080 0.4469
2 0.5329 0.0371
3 -0.3496 -0.0505
4 -0.6211 -0.4743
Whom should I trust?
P.S. I also checked that my auto values/autovectors are correct since they yield A*x-lambda*B*x=0, while the values from LAPACK do not.
I don't know why you think that LAPACK is giving incorrect answers, they seem fine to me. Using the four figure decimals that you quote I get residuals (r = A*x - lambda*B*x) such that
norm(r1) = 1.5921e-04, norm(r2) = 6.0842e-05.
Since norm(A) = 1.2994 and norm(B) = 7.9874, these residuals seem very satisfactory.
The eigenvectors produced by DSPGVX are normalized so that
norm(x'*B*x) = 1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With