lapackpp: Eigenvectors failing miserably...


[ Follow Ups ] [ Post Followup ] [ Netlib Discussion Forum ] [ FAQ ]

Posted by Didier Guillevic on February 19, 1998 at 04:00:12:

Hi,

I downloaded the following packages:

http://www.netlib.org/clapack/ clapack.tar.gz
http://www.netlib.org/c++/lapack++/ lapack++.shar

Installation, comipiling and testing on a Linux Box
(i686) went smoothly. All of the tests passed.
gcc version 2.7.2.2

Now when I try to test the Eigenvectors function,
it fails miserably, not by crashing, but by giving
some wrong answers.

LaEigSolve(A, v, Eigenvectors);

- For a simple 2x2 matrix, the answer is:

A(0,0) = 5;
A(0,1) = 3;
A(1,0) = 3;
A(1,1) = 5;

The function LaEigSolve() manages to have the
eigenvalues right:
Eigenvalues:
2
8
But can only get one of the eigenvector correct:
Eigenvectors:
4.54675 0.707107
0.707107 0.707107
Not Correct Correct

By doing several tests on 2x2 matrices, lapackpp is
consistent in getting the 2 eigenvalues right but
persist in giving one wrong eigenvetor.

- When testing on a 3x3 matrix, the performance is
even worse, as now not even the eigenvalues are
guessed correctly...
and of course much less the eigenvecttors...

- On a desperate attempt, I went to edit the testing
module in lapackpp/testing/tEigSolve.cc to see if
the error could come from my linking to something
wrong or whatever...
The output looks like:

beluga:[testing] 94> tEigSolve 2
Testing 2 x 2 system.
5.0000e+00 3.0000e+00
3.0000e+00 5.0000e+00

TestGenEigSolve() : testing LaEigSolve(LaSymmMat, eig_value, eig_vectors)
Eigenvalues:
2.0000e+00
8.0000e+00

Eigenvectors:
4.1561e+00 7.0711e-01
7.0711e-01 7.0711e-01

TestGenEigSolve() residual 1.97618e+15 is too high.
beluga:[testing] 95>

In fact I noticed that tests are made for values of
N = 1, 10, 30

Testing with those values (N = 1,10,30) give a nice
answer like:

beluga:[testing] 97> tEigSolve 1
Testing 1 x 1 system.
...
TestGenEigSolve() : LaEigSolve() success.

But testing for values of 2, 3, 4, 5,... fails each
time:

beluga:[testing] 98> tEigSolve 2
Testing 2 x 2 system.
-7.5875e-01 2.8769e-01
2.8769e-01 -7.5875e-01

TestGenEigSolve() : testing LaEigSolve(LaSymmMat, eig_value, eig_vectors)
Eigenvalues:
-1.0464e+00
-4.7106e-01

Eigenvectors:
4.1561e+00 7.0711e-01
-7.0711e-01 7.0711e-01

TestGenEigSolve() residual 1.02749e+15 is too high.
beluga:[testing] 99>

Question:
=========
- Sooooo my real question is... Has this code
TestGenEigSolve() EVER really been tested on simple
examples like 2x2 matrices?
- Is this code known to have worked for at least one
person?!
- I have a hard time imagining that the error could
come from my running on Intel hardware (even though
they are reputable for buggy chips)...

- Any help before I loose hope ?!

Thanks a LOT... for any help....

Didier


Follow Ups: