EVLRH
Computes all of the eigenvalues of a real upper Hessenberg matrix.
Required Arguments
A — Real upper Hessenberg matrix of order N. (Input)
EVAL — Complex vector of length N containing the eigenvalues in decreasing order of magnitude. (Output)
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).
FORTRAN 90 Interface
Generic: CALL EVLRH (A, EVAL [,])
Specific: The specific interface names are S_EVLRH and D_EVLRH.
FORTRAN 77 Interface
Single: CALL EVLRH (N, A, LDA, EVAL)
Double: The double precision name is DEVLRH.
Description
Routine EVLRH computes the eigenvalues of a real upper Hessenberg matrix by using the QR algorithm. The QR Algorithm routine is based on the EISPACK routine HQR, Smith et al. (1976).
Comments
1. Workspace may be explicitly provided, if desired, by use of E3LRH/DE3LRH. The reference is:
CALL E3LRH (N, A, LDA, EVAL, ACOPY, WK, IWK)
The additional arguments are as follows:
ACOPY — Real N by N work matrix.
WK — Real vector of length 3n.
IWK — Integer vector of length n.
2. Informational error
Type
Code
Description
4
1
The iteration for the eigenvalues failed to converge.
Example
In this example, a DATA statement is used to set A to an upper Hessenberg matrix of integers. The eigenvalues of this matrix are computed and printed.
 
USE EVLRH_INT
USE UMACH_INT
USE WRCRN_INT
 
IMPLICIT NONE
! Declare variables
INTEGER LDA, N
PARAMETER (N=4, LDA=N)
!
INTEGER NOUT
REAL A(LDA,N)
COMPLEX EVAL(N)
! Set values of A
!
! A = ( 2.0 1.0 3.0 4.0 )
! ( 1.0 0.0 0.0 0.0 )
! ( 1.0 0.0 0.0 )
! ( 1.0 0.0 )
!
DATA A/2.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 3.0, 0.0, 0.0, &
1.0, 4.0, 0.0, 0.0, 0.0/
!
! Find eigenvalues of A
CALL EVLRH (A, EVAL)
! Print results
CALL UMACH (2, NOUT)
CALL WRCRN ('EVAL', EVAL, 1, N, 1)
END
Output
 
EVAL
1 2 3 4
( 2.878, 0.000) ( 0.011, 1.243) ( 0.011,-1.243) (-0.900, 0.000)