1SGEGV(1) LAPACK driver routine (version 3.1) SGEGV(1)
2
3
4
6 SGEGV - i deprecated and has been replaced by routine SGGEV
7
9 SUBROUTINE SGEGV( JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHAR, ALPHAI,
10 BETA, VL, LDVL, VR, LDVR, WORK, LWORK, INFO )
11
12 CHARACTER JOBVL, JOBVR
13
14 INTEGER INFO, LDA, LDB, LDVL, LDVR, LWORK, N
15
16 REAL A( LDA, * ), ALPHAI( * ), ALPHAR( * ), B( LDB, * ),
17 BETA( * ), VL( LDVL, * ), VR( LDVR, * ), WORK( * )
18
20 This routine is deprecated and has been replaced by routine SGGEV.
21
22 SGEGV computes the eigenvalues and, optionally, the left and/or right
23 eigenvectors of a real matrix pair (A,B).
24 Given two square matrices A and B,
25 the generalized nonsymmetric eigenvalue problem (GNEP) is to find the
26 eigenvalues lambda and corresponding (non-zero) eigenvectors x such
27 that
28
29 A*x = lambda*B*x.
30
31 An alternate form is to find the eigenvalues mu and corresponding
32 eigenvectors y such that
33
34 mu*A*y = B*y.
35
36 These two forms are equivalent with mu = 1/lambda and x = y if neither
37 lambda nor mu is zero. In order to deal with the case that lambda or
38 mu is zero or small, two values alpha and beta are returned for each
39 eigenvalue, such that lambda = alpha/beta and
40 mu = beta/alpha.
41
42 The vectors x and y in the above equations are right eigenvectors of
43 the matrix pair (A,B). Vectors u and v satisfying
44
45 u**H*A = lambda*u**H*B or mu*v**H*A = v**H*B
46
47 are left eigenvectors of (A,B).
48
49 Note: this routine performs "full balancing" on A and B -- see "Further
50 Details", below.
51
53 JOBVL (input) CHARACTER*1
54 = 'N': do not compute the left generalized eigenvectors;
55 = 'V': compute the left generalized eigenvectors (returned in
56 VL).
57
58 JOBVR (input) CHARACTER*1
59 = 'N': do not compute the right generalized eigenvectors;
60 = 'V': compute the right generalized eigenvectors (returned in
61 VR).
62
63 N (input) INTEGER
64 The order of the matrices A, B, VL, and VR. N >= 0.
65
66 A (input/output) REAL array, dimension (LDA, N)
67 On entry, the matrix A. If JOBVL = 'V' or JOBVR = 'V', then on
68 exit A contains the real Schur form of A from the generalized
69 Schur factorization of the pair (A,B) after balancing. If no
70 eigenvectors were computed, then only the diagonal blocks from
71 the Schur form will be correct. See SGGHRD and SHGEQZ for
72 details.
73
74 LDA (input) INTEGER
75 The leading dimension of A. LDA >= max(1,N).
76
77 B (input/output) REAL array, dimension (LDB, N)
78 On entry, the matrix B. If JOBVL = 'V' or JOBVR = 'V', then on
79 exit B contains the upper triangular matrix obtained from B in
80 the generalized Schur factorization of the pair (A,B) after
81 balancing. If no eigenvectors were computed, then only those
82 elements of B corresponding to the diagonal blocks from the
83 Schur form of A will be correct. See SGGHRD and SHGEQZ for
84 details.
85
86 LDB (input) INTEGER
87 The leading dimension of B. LDB >= max(1,N).
88
89 ALPHAR (output) REAL array, dimension (N)
90 The real parts of each scalar alpha defining an eigenvalue of
91 GNEP.
92
93 ALPHAI (output) REAL array, dimension (N)
94 The imaginary parts of each scalar alpha defining an eigenvalue
95 of GNEP. If ALPHAI(j) is zero, then the j-th eigenvalue is
96 real; if positive, then the j-th and (j+1)-st eigenvalues are a
97 complex conjugate pair, with ALPHAI(j+1) = -ALPHAI(j).
98
99 BETA (output) REAL array, dimension (N)
100 The scalars beta that define the eigenvalues of GNEP.
101 Together, the quantities alpha = (ALPHAR(j),ALPHAI(j)) and beta
102 = BETA(j) represent the j-th eigenvalue of the matrix pair
103 (A,B), in one of the forms lambda = alpha/beta or mu =
104 beta/alpha. Since either lambda or mu may overflow, they
105 should not, in general, be computed.
106
107 VL (output) REAL array, dimension (LDVL,N)
108 If JOBVL = 'V', the left eigenvectors u(j) are stored in the
109 columns of VL, in the same order as their eigenvalues. If the
110 j-th eigenvalue is real, then u(j) = VL(:,j). If the j-th and
111 (j+1)-st eigenvalues form a complex conjugate pair, then u(j) =
112 VL(:,j) + i*VL(:,j+1) and u(j+1) = VL(:,j) - i*VL(:,j+1).
113
114 Each eigenvector is scaled so that its largest component has
115 abs(real part) + abs(imag. part) = 1, except for eigenvectors
116 corresponding to an eigenvalue with alpha = beta = 0, which are
117 set to zero. Not referenced if JOBVL = 'N'.
118
119 LDVL (input) INTEGER
120 The leading dimension of the matrix VL. LDVL >= 1, and if JOBVL
121 = 'V', LDVL >= N.
122
123 VR (output) REAL array, dimension (LDVR,N)
124 If JOBVR = 'V', the right eigenvectors x(j) are stored in the
125 columns of VR, in the same order as their eigenvalues. If the
126 j-th eigenvalue is real, then x(j) = VR(:,j). If the j-th and
127 (j+1)-st eigenvalues form a complex conjugate pair, then x(j) =
128 VR(:,j) + i*VR(:,j+1) and x(j+1) = VR(:,j) - i*VR(:,j+1).
129
130 Each eigenvector is scaled so that its largest component has
131 abs(real part) + abs(imag. part) = 1, except for eigenvalues
132 corresponding to an eigenvalue with alpha = beta = 0, which are
133 set to zero. Not referenced if JOBVR = 'N'.
134
135 LDVR (input) INTEGER
136 The leading dimension of the matrix VR. LDVR >= 1, and if JOBVR
137 = 'V', LDVR >= N.
138
139 WORK (workspace/output) REAL array, dimension (MAX(1,LWORK))
140 On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
141
142 LWORK (input) INTEGER
143 The dimension of the array WORK. LWORK >= max(1,8*N). For
144 good performance, LWORK must generally be larger. To compute
145 the optimal value of LWORK, call ILAENV to get blocksizes (for
146 SGEQRF, SORMQR, and SORGQR.) Then compute: NB -- MAX of the
147 blocksizes for SGEQRF, SORMQR, and SORGQR; The optimal LWORK
148 is: 2*N + MAX( 6*N, N*(NB+1) ).
149
150 If LWORK = -1, then a workspace query is assumed; the routine
151 only calculates the optimal size of the WORK array, returns
152 this value as the first entry of the WORK array, and no error
153 message related to LWORK is issued by XERBLA.
154
155 INFO (output) INTEGER
156 = 0: successful exit
157 < 0: if INFO = -i, the i-th argument had an illegal value.
158 = 1,...,N: The QZ iteration failed. No eigenvectors have been
159 calculated, but ALPHAR(j), ALPHAI(j), and BETA(j) should be
160 correct for j=INFO+1,...,N. > N: errors that usually indicate
161 LAPACK problems:
162 =N+1: error return from SGGBAL
163 =N+2: error return from SGEQRF
164 =N+3: error return from SORMQR
165 =N+4: error return from SORGQR
166 =N+5: error return from SGGHRD
167 =N+6: error return from SHGEQZ (other than failed iteration)
168 =N+7: error return from STGEVC
169 =N+8: error return from SGGBAK (computing VL)
170 =N+9: error return from SGGBAK (computing VR)
171 =N+10: error return from SLASCL (various calls)
172
174 Balancing
175 ---------
176
177 This driver calls SGGBAL to both permute and scale rows and columns of
178 A and B. The permutations PL and PR are chosen so that PL*A*PR and
179 PL*B*R will be upper triangular except for the diagonal blocks
180 A(i:j,i:j) and B(i:j,i:j), with i and j as close together as possible.
181 The diagonal scaling matrices DL and DR are chosen so that the pair
182 DL*PL*A*PR*DR, DL*PL*B*PR*DR have elements close to one (except for the
183 elements that start out zero.)
184
185 After the eigenvalues and eigenvectors of the balanced matrices have
186 been computed, SGGBAK transforms the eigenvectors back to what they
187 would have been (in perfect arithmetic) if they had not been balanced.
188
189 Contents of A and B on Exit
190 -------- -- - --- - -- ----
191
192 If any eigenvectors are computed (either JOBVL='V' or JOBVR='V' or
193 both), then on exit the arrays A and B will contain the real Schur
194 form[*] of the "balanced" versions of A and B. If no eigenvectors are
195 computed, then only the diagonal blocks will be correct.
196
197 [*] See SHGEQZ, SGEGS, or read the book "Matrix Computations",
198 by Golub & van Loan, pub. by Johns Hopkins U. Press.
199
200
201
202
203 LAPACK driver routine (version 3.N1o)vember 2006 SGEGV(1)