2
SUBROUTINE RSGBA (NM, N, A, B, W, MATZ, Z, FV1, FV2, IERR)
3
C***BEGIN PROLOGUE RSGBA
4
C***PURPOSE Compute the eigenvalues and, optionally, the eigenvectors
5
C of a symmetric generalized eigenproblem.
6
C***LIBRARY SLATEC (EISPACK)
8
C***TYPE SINGLE PRECISION (RSGBA-S)
9
C***KEYWORDS EIGENVALUES, EIGENVECTORS, EISPACK
10
C***AUTHOR Smith, B. T., et al.
13
C This subroutine calls the recommended sequence of
14
C subroutines from the eigensystem subroutine package (EISPACK)
15
C to find the eigenvalues and eigenvectors (if desired)
16
C for the REAL SYMMETRIC generalized eigenproblem BAx = (LAMBDA)x.
20
C NM must be set to the row dimension of the two-dimensional
21
C array parameters, A, B, and Z, as declared in the calling
22
C program dimension statement. NM is an INTEGER variable.
24
C N is the order of the matrices A and B. N is an INTEGER
25
C variable. N must be less than or equal to NM.
27
C A contains a real symmetric matrix. A is a two-dimensional
28
C REAL array, dimensioned A(NM,N).
30
C B contains a positive definite real symmetric matrix. B is a
31
C two-dimensional REAL array, dimensioned B(NM,N).
33
C MATZ is an INTEGER variable set equal to zero if only
34
C eigenvalues are desired. Otherwise, it is set to any
35
C non-zero integer for both eigenvalues and eigenvectors.
39
C W contains the eigenvalues in ascending order. W is a
40
C one-dimensional REAL array, dimensioned W(N).
42
C Z contains the eigenvectors if MATZ is not zero. Z is a
43
C two-dimensional REAL array, dimensioned Z(NM,N).
45
C IERR is an INTEGER flag set to
46
C Zero for normal return,
47
C 10*N if N is greater than NM,
48
C 7*N+1 if B is not positive definite,
49
C J if the J-th eigenvalue has not been
50
C determined after 30 iterations.
51
C The eigenvalues should be correct for indices
52
C 1, 2, ..., IERR-1, but no eigenvectors are
55
C FV1 and FV2 are one-dimensional REAL arrays used for temporary
56
C storage, dimensioned FV1(N) and FV2(N).
58
C Questions and comments should be directed to B. S. Garbow,
59
C APPLIED MATHEMATICS DIVISION, ARGONNE NATIONAL LABORATORY
60
C ------------------------------------------------------------------
62
C***REFERENCES B. T. Smith, J. M. Boyle, J. J. Dongarra, B. S. Garbow,
63
C Y. Ikebe, V. C. Klema and C. B. Moler, Matrix Eigen-
64
C system Routines - EISPACK Guide, Springer-Verlag,
66
C***ROUTINES CALLED REBAKB, REDUC2, TQL2, TQLRAT, TRED1, TRED2
67
C***REVISION HISTORY (YYMMDD)
69
C 890831 Modified array declarations. (WRB)
70
C 890831 REVISION DATE from Version 3.2
71
C 891214 Prologue converted to Version 4.0 format. (BAB)
72
C 920501 Reformatted the REFERENCES section. (WRB)
73
C***END PROLOGUE RSGBA
75
INTEGER N,NM,IERR,MATZ
76
REAL A(NM,*),B(NM,*),W(*),Z(NM,*),FV1(*),FV2(*)
78
C***FIRST EXECUTABLE STATEMENT RSGBA
79
IF (N .LE. NM) GO TO 10
83
10 CALL REDUC2(NM,N,A,B,FV2,IERR)
84
IF (IERR .NE. 0) GO TO 50
85
IF (MATZ .NE. 0) GO TO 20
86
C .......... FIND EIGENVALUES ONLY ..........
87
CALL TRED1(NM,N,A,W,FV1,FV2)
88
CALL TQLRAT(N,W,FV2,IERR)
90
C .......... FIND BOTH EIGENVALUES AND EIGENVECTORS ..........
91
20 CALL TRED2(NM,N,A,W,FV1,Z)
92
CALL TQL2(NM,N,W,FV1,Z,IERR)
93
IF (IERR .NE. 0) GO TO 50
94
CALL REBAKB(NM,N,B,FV2,N,Z)