EVCRG

   more...
Computes all of the eigenvalues and eigenvectors of a real matrix.
Required Arguments
A — Floating-point array containing the matrix. (Input)
EVAL — Complex array of size N containing the eigenvalues of A in decreasing order of magnitude. (Output)
EVEC — Complex array containing the matrix of eigenvectors. (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. (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).
LDEVEC — Leading dimension of EVEC exactly as specified in the dimension statement of the calling program. (Input)
Default: LDEVEC = SIZE (EVEC,1).
FORTRAN 90 Interface
Generic: CALL EVCRG (A, EVAL, EVEC [,])
Specific: The specific interface names are S_EVCRG and D_EVCRG.
FORTRAN 77 Interface
Single: CALL EVCRG (N, A, LDA, EVAL, EVEC, LDEVEC)
Double: The double precision name is DEVCRG.
Description
Routine EVCRG computes the eigenvalues and eigenvectors of a real matrix. The matrix is first balanced. Orthogonal similarity transformations are used to reduce the balanced matrix to a real upper Hessenberg matrix. The implicit double shifted QR algorithm is used to compute the eigenvalues and eigenvectors of this Hessenberg matrix. The eigenvectors are normalized such that each has Euclidean length of value one. The largest component is real and positive.
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 E8CRG/DE8CRG. The reference is:
CALL E8CRG (N, A, LDA, EVAL, EVEC, LDEVEC, ACOPY, ECOPY, WK, IWK)
The additional arguments are as follows:
ACOPY — Floating-point work array of size N by N. The arrays A and ACOPY may be the same, in which case the first N2 elements of A will be destroyed. The array ACOPY can have its working row dimension increased from N to a larger value. An optional usage is required. See Item 3 below for further details.
ECOPY — Floating-point work array of default size N by N + 1. The working, leading dimension of ECOPY is the same as that for ACOPY. To increase this value, an optional usage is required. See Item 3 below for further details.
WK — Floating-point work array of size 6N.
IWK — Integer work array of size N.
2. Informational error
Type
Code
Description
4
1
The iteration for the eigenvalues failed to converge. No eigenvalues or eigenvectors are computed.
3. Integer Options with Chapter 11 Options Manager
1 This option uses eight values to solve memory bank conflict (access inefficiency) problems. In routine E8CRG, the internal or working leading dimensions of ACOPY and ECOPY are both 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 EVCRG. Additional memory allocation and option value restoration are automatically done in EVCRG. There is no requirement that users change existing applications that use EVCRG or E8CRG. 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 EVCRG.
Example
In this example, a DATA statement is used to set A to a matrix given by Gregory and Karney (1969, page 82). The eigenvalues and eigenvectors of this real 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 IMSL routine EPIRG.
 
USE EVCRG_INT
USE EPIRG_INT
USE UMACH_INT
USE WRCRN_INT
 
IMPLICIT NONE
! Declare variables
INTEGER LDA, LDEVEC, N
PARAMETER (N=3, LDA=N, LDEVEC=N)
INTEGER NOUT
REAL PI
COMPLEX EVAL(N), EVEC(LDEVEC,N)
REAL A(LDA,N)
 
! Define values of A:
!
! A = ( 8.0 -1.0 -5.0 )
! ( -4.0 4.0 -2.0 )
! ( 18.0 -5.0 -7.0 )
!
DATA A/8.0, -4.0, 18.0, -1.0, 4.0, -5.0, -5.0, -2.0, -7.0/
!
! Find eigenvalues and vectors of A
CALL EVCRG (A, EVAL, EVEC)
! Compute performance index
PI = EPIRG(N,A,EVAL,EVEC)
! Print results
CALL UMACH (2, NOUT)
CALL WRCRN ('EVAL', EVAL, 1, N, 1)
CALL WRCRN ('EVEC', EVEC)
WRITE (NOUT,'(/,A,F6.3)') ' Performance index = ', PI
END
Output
EVAL
1 2 3
( 2.000, 4.000) ( 2.000,-4.000) ( 1.000, 0.000)
EVEC
1 2 3
1 ( 0.3162, 0.3162) ( 0.3162,-0.3162) ( 0.4082, 0.0000)
2 (-0.0000, 0.6325) (-0.0000,-0.6325) ( 0.8165, 0.0000)
3 ( 0.6325, 0.0000) ( 0.6325, 0.0000) ( 0.4082, 0.0000)
 
Performance index = 0.026