PDA

View Full Version : Fortran90: Subroutine DSYEV and associating eigenvalues and eigenvectors.


Animastryfe
Nov7-11, 02:27 PM
Greetings. I am using the LAPACK (Linear Algebra Package) software package to find the eigenvalues and eigenvectors of a large symmetrical real matrix. Specifically, I calculate a scalar from each eigenvector, and I want to graph it against its associated eigenvalue.

I am using the subroutine DSYEV of LAPACK to do this. However, DSYEV outputs the eigenvalues in ascending order, and I'm not sure how it orders the eigenvectors. Is there a way to associate each eigenvector with its eigenvalue?

Edit: The official page for DSYEV is here: http://www.netlib.org/lapack/double/dsyev.f
Here is another page about it: http://www.nag.co.uk/numeric/fl/nagdoc_fl22/xhtml/F08/f08faf.xml

AlephZero
Nov7-11, 03:36 PM
The eigenvectors are returned in the A matrix in the same order as the eigenvalues.

A(1:N, 1) is the vector for W(1), A(1:N, 2) is the vector for W(2), etc.

Animastryfe
Nov7-11, 04:24 PM
Thank you very much for the reply.

Just to be completely clear: the columns of the matrix A are the eigenvectors?

AlephZero
Nov7-11, 05:35 PM
If you set JOBV = "V", then yes. Otherwise, no!