Calculate the eigenvalues and eigenvectors of a real symmetric matrix
A using LAPACK’s dsyev. The eigenvectors are stored in the columns
of eigenvectors. The eigenvalues are stored in eigenvalues.
call eigen(A, lambda, vectors)
The current implementation requests eigenvectors from LAPACK and
assigns them to eigenvectors; provide this optional argument.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=pr), | intent(inout) | :: | A(:,:) |
Symmetric matrix; overwritten by LAPACK work data. |
||
| real(kind=pr), | intent(out) | :: | eigenvalues(:) |
Eigenvalues in ascending order. |
||
| real(kind=pr), | intent(out), | optional | :: | eigenvectors(:,:) |
Eigenvectors stored as columns. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | public | :: | Ain(size(A,1),size(A,1)) | ||||
| integer, | public | :: | istat | ||||
| integer, | public | :: | n | ||||
| real(kind=pr), | public | :: | work(size(A,1)*10) |
Numerical workspace. |
LAPACK interface for a real symmetric eigenproblem.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=1) | :: | JOBZ |
Whether eigenvectors are computed. |
|||
| character(len=1) | :: | UPLO |
Triangle of the input matrix that is referenced. |
|||
| integer | :: | N |
Matrix order. |
|||
| double precision | :: | A(lda,*) |
Matrix/work array. |
|||
| integer | :: | lda |
Leading dimension of |
|||
| double precision | :: | W(*) |
Eigenvalues. |
|||
| double precision | :: | WORK(*) |
Workspace array. |
|||
| integer | :: | LWORK |
Workspace length. |
|||
| integer | :: | INFO |
LAPACK status code. |