EVLRG

   more...
Computes all of the eigenvalues of a real matrix.
Required Arguments
A — Real full matrix of order N. (Input)
EVAL — Complex vector of length N containing the eigenvalues of A in decreasing order of magnitude. (Output)
Optional Arguments
N — Order of the matrix. (Input)
Default: N = SIZE (A,2).
LDA — Leading dimension of A exactly as specified in the dimension statement of the calling program. (Input)
Default: LDA = SIZE (A,1).
FORTRAN 90 Interface
Generic: CALL EVLRG (A, EVAL [,])
Specific: The specific interface names are S_EVLRG and D_EVLRG.
FORTRAN 77 Interface
Single: CALL EVLRG (N, A, LDA, EVAL)
Double: The double precision name is DEVLRG.
Description
Routine EVLRG computes the eigenvalues of a real matrix. The matrix is first balanced. Elementary or Gauss similarity transformations with partial pivoting are used to reduce this balanced matrix to a real upper Hessenberg matrix. A hybrid double — shifted LR — QR algorithm is used to compute the eigenvalues of the Hessenberg matrix, Watkins and Elsner (1990).
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. The LR— QR algorithm is based on software work of Watkins and Haag. 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 E3LRG/DE3LRG. The reference is:
CALL E3LRG (N, A, LDA, EVAL, ACOPY, WK, IWK)
The additional arguments are as follows:
ACOPY — Real work array of length N2. A and ACOPY may be the same, in which case the first N2 elements of A will be destroyed.
WK — Floating-point work array of size 4N.
IWK — Integer work array of size 2N.
2. Informational error
Type
Code
Description
4
1
The iteration for an eigenvalue failed to converge.
3. Integer Options with Chapter 11 Options Manager
1 This option uses eight values to solve memory bank conflict (access inefficiency) problems. In routine E3LRG, the internal or working leading dimension of ACOPY is increased by IVAL(3) when N is a multiple of IVAL(4). The values IVAL(3) and IVAL(4) are temporarily replaced by IVAL(1) and IVAL(2), respectively, in routine EVLRG . Additional memory allocation and option value restoration are automatically done in EVLRG. There is no requirement that users change existing applications that use EVLRG or E3LRG. Default values for the option are IVAL(*) = 1, 16, 0, 1, 1, 16, 0, 1. Items 5-8 in IVAL(*) are for the generalized eigenvalue problem and are not used in EVLRG.
Example
In this example, a DATA statement is used to set A to a matrix given by Gregory and Karney (1969, page 85). The eigenvalues of this real matrix are computed and printed. The exact eigenvalues are known to be {4, 3, 2, 1}.
 
USE EVLRG_INT
USE WRCRN_INT
 
IMPLICIT NONE
! Declare variables
INTEGER LDA, N
PARAMETER (N=4, LDA=N)
!
REAL A(LDA,N)
COMPLEX EVAL(N)
 
! Set values of A
!
! A = ( -2.0 2.0 2.0 2.0 )
! ( -3.0 3.0 2.0 2.0 )
! ( -2.0 0.0 4.0 2.0 )
! ( -1.0 0.0 0.0 5.0 )
DATA A/-2.0, -3.0, -2.0, -1.0, 2.0, 3.0, 0.0, 0.0, 2.0, 2.0, &
4.0, 0.0, 2.0, 2.0, 2.0, 5.0/
!
! Find eigenvalues of A
CALL EVLRG (A, EVAL)
! Print results
CALL WRCRN ('EVAL', EVAL, 1, N, 1)
END
Output
EVAL
1 2 3 4
( 4.000, 0.000) ( 3.000, 0.000) ( 2.000, 0.000) ( 1.000, 0.000)