EVESF
Computes the largest or smallest eigenvalues and the corresponding eigenvectors of a real symmetric matrix.
Required Arguments
NEVEC — Number of eigenvalues to be computed. (Input)
A — Real symmetric matrix of order N. (Input)
SMALL — Logical variable. (Input)
If .TRUE., the smallest NEVEC eigenvalues are computed. If .FALSE., the largest NEVEC eigenvalues are computed.
EVAL — Real vector of length NEVEC containing the eigenvalues of A in decreasing order of magnitude. (Output)
EVEC — Real matrix of dimension N by NEVEC. (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 EVESF (NEVEC, A, SMALL, EVAL, EVEC [,…])
Specific: The specific interface names are S_EVESF and D_EVESF.
FORTRAN 77 Interface
Single: CALL EVESF (N, NEVEC, A, LDA, SMALL, EVAL, EVEC, LDEVEC)
Double: The double precision name is DEVESF.
Description
Routine EVESF computes the largest or smallest eigenvalues and the corresponding eigenvectors of a real symmetric matrix. Orthogonal similarity transformations are used to reduce the matrix to an equivalent symmetric tridiagonal matrix. Then, an implicit rational QR algorithm is used to compute the eigenvalues of this tridiagonal matrix. Inverse iteration is used to compute the eigenvectors of the tridiagonal matrix. This is followed by orthogonalization of these vectors. The eigenvectors of the original matrix are computed by back transforming those of the tridiagonal matrix.
The reduction routine is based on the EISPACK routine TRED2. See Smith et al. (1976). The rational QR algorithm is called the PWK algorithm. It is given in Parlett (1980, page 169). The inverse iteration and orthogonalization computation is discussed in Hanson et al. (1990). The back transformation routine is based on the EISPACK routine TRBAK1.
Comments
1. Workspace may be explicitly provided, if desired, by use of E5ESF/DE5ESF. The reference is:
CALL E5ESF (N, NEVEC, A, LDA, SMALL, EVAL, EVEC, LDEVEC, WK, IWK)
The additional arguments are as follows:
WK — Work array of length 9N.
IWK — Integer array of length N.
2. Informational errors
Type | Code | Description |
---|
3 | 1 | The iteration for an eigenvalue failed to converge. The best estimate will be returned. |
3 | 2 | Inverse iteration did not converge. Eigenvector is not correct for the specified eigenvalue. |
3 | 3 | The eigenvectors have lost orthogonality. |
Example
In this example, a
DATA statement is used to set
A to a matrix given by Gregory and Karney (1969, page 55). The largest two eigenvalues and their eigenvectors are computed and printed. The performance index is also computed and printed. This serves as a check on the computations. For more details, see IMSL routine
EPISF.
USE EVESF_INT
USE EPISF_INT
USE UMACH_INT
USE WRRRN_INT
IMPLICIT NONE
! Declare variables
INTEGER LDA, LDEVEC, N
PARAMETER (N=4, LDA=N, LDEVEC=N)
!
INTEGER NEVEC, NOUT
REAL A(LDA,N), EVAL(N), EVEC(LDEVEC,N), PI
LOGICAL SMALL
!
! Set values of A
!
! A = ( 5.0 4.0 1.0 1.0)
! ( 4.0 5.0 1.0 1.0)
! ( 1.0 1.0 4.0 2.0)
! ( 1.0 1.0 2.0 4.0)
!
DATA A/5.0, 4.0, 1.0, 1.0, 4.0, 5.0, 1.0, 1.0, 1.0, 1.0, 4.0, &
2.0, 1.0, 1.0, 2.0, 4.0/
!
! Find eigenvalues and vectors of A
NEVEC = 2
SMALL = .FALSE.
CALL EVESF (NEVEC, A, SMALL, EVAL, EVEC)
! Compute performance index
PI = EPISF(NEVEC,A,EVAL,EVEC)
! Print results
CALL UMACH (2, NOUT)
CALL WRRRN ('EVAL', EVAL, 1, NEVEC, 1)
CALL WRRRN ('EVEC', EVEC, N, NEVEC, LDEVEC)
WRITE (NOUT,'(/,A,F6.3)') ' Performance index = ', PI
END
Output
EVAL
1 2
10.00 5.00
EVEC
1 2
1 0.6325 -0.3162
2 0.6325 -0.3162
3 0.3162 0.6325
4 0.3162 0.6325
Performance index = 0.031