EVCSF
Computes all of the eigenvalues and eigenvectors of a real symmetric matrix.
Required Arguments
A — Real symmetric matrix of order N. (Input)
EVAL — Real vector of length N containing the eigenvalues of A in decreasing order of magnitude. (Output)
EVEC — Real matrix of order N. (Output)
The J-th eigenvector, corresponding to EVAL(J), is stored in the J-th column. Each vector is normalized to have Euclidean length equal to the value one.
Optional Arguments
N — Order of the matrix A. (Input)
Default: N = SIZE (A,2).
LDA — Leading dimension of A exactly as specified in the dimension statement in the calling program. (Input)
Default: LDA = SIZE (A,1).
LDEVEC — Leading dimension of EVEC exactly as specified in the dimension statement in the calling program. (Input)
Default: LDEVEC = SIZE (EVEC,1).
FORTRAN 90 Interface
Generic: CALL EVCSF (A, EVAL, EVEC [,…])
Specific: The specific interface names are S_EVCSF and D_EVCSF.
FORTRAN 77 Interface
Single: CALL EVCSF (N, A, LDA, EVAL, EVEC, LDEVEC)
Double: The double precision name is DEVCSF.
Description
Routine EVCSF computes the eigenvalues and eigenvectors of a real symmetric matrix. Orthogonal similarity transformations are used to reduce the matrix to an equivalent symmetric tridiagonal matrix. These transformations are accumulated. An implicit rational QR algorithm is used to compute the eigenvalues of this tridiagonal matrix. The eigenvectors are computed using the eigenvalues as perfect shifts, Parlett (1980, pages 169, 172). The underlying code is based on either EISPACK or LAPACK code depending upon which supporting libraries are used during linking. For a detailed explanation, see “Using ScaLAPACK, LAPACK, LINPACK, and EISPACK” in the Introduction section of this manual. Further details, some timing data, and credits are given in Hanson et al. (1990).
Comments
1. Workspace may be explicitly provided, if desired, by use of E5CSF/DE5CSF. The reference is:
CALL E5CSF (N, A, LDA, EVAL, EVEC, LDEVEC, WORK, IWK)
The additional argument is:
WORK — Work array of length 3N.
IWK — Integer array of length N.
2. Informational error
Type |
Code |
Description |
3 |
1 |
The iteration for the eigenvalue failed to converge in 100 iterations before deflating. |
Example
The eigenvalues and eigenvectors of this real symmetric matrix are computed and printed. The performance index is also computed and printed. This serves as a check on the computations. For more details, see EPISF.
USE EVCSF_INT
USE EPISF_INT
USE UMACH_INT
USE WRRRN_INT
IMPLICIT NONE
! Declare variables
INTEGER LDA, LDEVEC, N
PARAMETER (N=3, LDA=N, LDEVEC=N)
!
INTEGER NOUT
REAL A(LDA,N), EVAL(N), EVEC(LDEVEC,N), PI
!
! Set values of A
!
! A = ( 7.0 -8.0 -8.0)
! ( -8.0 -16.0 -18.0)
! ( -8.0 -18.0 13.0)
!
DATA A/7.0, -8.0, -8.0, -8.0, -16.0, -18.0, -8.0, -18.0, 13.0/
!
! Find eigenvalues and vectors of A
CALL EVCSF (A, EVAL, EVEC)
! Compute performance index
PI = EPISF (N, A, EVAL, EVEC)
! Print results
CALL UMACH (2, NOUT)
CALL WRRRN ('EVAL', EVAL, 1, N, 1)
CALL WRRRN ('EVEC', EVEC)
WRITE (NOUT, '(/,A,F6.3)') ' Performance index = ', PI
END
EVAL
1 2 3
-27.90 22.68 9.22
EVEC
1 2 3
1 0.2945 -0.2722 0.9161
2 0.8521 -0.3591 -0.3806
3 0.4326 0.8927 0.1262
Performance index = 0.019