GVLRG
Computes all of the eigenvalues of a generalized real eigensystem Az = λBz.
Required Arguments
A — Real matrix of order N. (Input)
B — Real matrix of order N. (Input)
ALPHA — Complex vector of size N containing scalars αi , i = 1, n. If βi  0, λi = αi / βi the eigenvalues of the system in decreasing order of magnitude. (Output)
BETAV — Vector of size N containing scalars βi. (Output)
Optional Arguments
N — Order of the matrices A and B. (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).
LDB — Leading dimension of B exactly as specified in the dimension statement in the calling program. (Input)
Default: LDB = SIZE (B,1).
FORTRAN 90 Interface
Generic: CALL GVLRG (A, B, ALPHA, BETAV [,])
Specific: The specific interface names are S_GVLRG and D_GVLRG.
FORTRAN 77 Interface
Single: CALL GVLRG (N, A, LDA, B, LDB, ALPHA, BETAV)
Double: The double precision name is DGVLRG.
Description
Routine GVLRG computes the eigenvalues of the generalized eigensystem Ax = λBx where A and B are real matrices of order N. The eigenvalues for this problem can be infinite; so instead of returning λ, GVLRG returns α and β. If β is nonzero, then λ = α/β.
The first step of the QZ algorithm is to simultaneously reduce A to upper Hessenberg form and B to upper triangular form. Then, orthogonal transformations are used to reduce A to quasi-upper-triangular form while keeping B upper triangular. The generalized eigenvalues are then computed.
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.
Comments
1. Workspace may be explicitly provided, if desired, by use of G3LRG/DG3LRG. The reference is:
CALL G3LRG (N, A, LDA, B, LDB, ALPHA, BETAV, ACOPY, BCOPY, RWK, CWK, IWK)
The additional arguments are as follows:
ACOPY — Work array of size N2. The arrays A and ACOPY may be the same, in which case the first N2 elements of A will be destroyed.
BCOPY — Work array of size N2. The arrays B and BCOPY may be the same, in which case the first N2 elements of B will be destroyed.
RWK — Real work array of size N.
CWK — Complex work array of size N.
IWK — Integer work array of size N.
2. Integer Options with Chapter 11 Options Manager
1 This option uses eight values to solve memory bank conflict (access inefficiency) problems. In routine G3LRG, 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 GVLRG. Analogous comments hold for BCOPY and the values IVAL(5) IVAL(8). Additional memory allocation and option value restoration are automatically done in GVLRG. There is no requirement that users change existing applications that use GVLRG or G3LRG. Default values for the option are IVAL(*) = 1, 16, 0, 1, 1, 16, 0, 1.
Example
In this example, DATA statements are used to set A and B. The eigenvalues are computed and printed.
 
USE IMSL_LIBRARIES
 
IMPLICIT NONE
INTEGER LDA, LDB, N
PARAMETER (N=3, LDA=N, LDB=N)
!
INTEGER I
REAL A(LDA,N), B(LDB,N), BETAV(N)
COMPLEX ALPHA(N), EVAL(N)
!
! Set values of A and B
! A = ( 1.0 0.5 0.0 )
! (-10.0 2.0 0.0 )
! ( 5.0 1.0 0.5 )
!
! B = ( 0.5 0.0 0.0 )
! ( 3.0 3.0 0.0 )
! ( 4.0 0.5 1.0 )
!
! Declare variables
DATA A/1.0, -10.0, 5.0, 0.5, 2.0, 1.0, 0.0, 0.0, 0.5/
DATA B/0.5, 3.0, 4.0, 0.0, 3.0, 0.5, 0.0, 0.0, 1.0/
!
CALL GVLRG (A, B, ALPHA, BETAV)
! Compute eigenvalues
DO 10 I=1, N
EVAL(I) = ALPHA(I)/BETAV(I)
10 CONTINUE
! Print results
CALL WRCRN ('EVAL', EVAL, 1, N, 1)
END
Output
EVAL
1 2 3
( 0.833, 1.993) ( 0.833,-1.993) ( 0.500, 0.000)