1SGGES(1) LAPACK driver routine (version 3.1) SGGES(1)
2
3
4
6 SGGES - for a pair of N-by-N real nonsymmetric matrices (A,B),
7
9 SUBROUTINE SGGES( JOBVSL, JOBVSR, SORT, SELCTG, N, A, LDA, B, LDB,
10 SDIM, ALPHAR, ALPHAI, BETA, VSL, LDVSL, VSR, LDVSR,
11 WORK, LWORK, BWORK, INFO )
12
13 CHARACTER JOBVSL, JOBVSR, SORT
14
15 INTEGER INFO, LDA, LDB, LDVSL, LDVSR, LWORK, N, SDIM
16
17 LOGICAL BWORK( * )
18
19 REAL A( LDA, * ), ALPHAI( * ), ALPHAR( * ), B( LDB, * ),
20 BETA( * ), VSL( LDVSL, * ), VSR( LDVSR, * ), WORK( *
21 )
22
23 LOGICAL SELCTG
24
25 EXTERNAL SELCTG
26
28 SGGES computes for a pair of N-by-N real nonsymmetric matrices (A,B),
29 the generalized eigenvalues, the generalized real Schur form (S,T),
30 optionally, the left and/or right matrices of Schur vectors (VSL and
31 VSR). This gives the generalized Schur factorization
32
33 (A,B) = ( (VSL)*S*(VSR)**T, (VSL)*T*(VSR)**T )
34
35 Optionally, it also orders the eigenvalues so that a selected cluster
36 of eigenvalues appears in the leading diagonal blocks of the upper
37 quasi-triangular matrix S and the upper triangular matrix T.The leading
38 columns of VSL and VSR then form an orthonormal basis for the corre‐
39 sponding left and right eigenspaces (deflating subspaces).
40
41 (If only the generalized eigenvalues are needed, use the driver SGGEV
42 instead, which is faster.)
43
44 A generalized eigenvalue for a pair of matrices (A,B) is a scalar w or
45 a ratio alpha/beta = w, such that A - w*B is singular. It is usually
46 represented as the pair (alpha,beta), as there is a reasonable inter‐
47 pretation for beta=0 or both being zero.
48
49 A pair of matrices (S,T) is in generalized real Schur form if T is
50 upper triangular with non-negative diagonal and S is block upper trian‐
51 gular with 1-by-1 and 2-by-2 blocks. 1-by-1 blocks correspond to real
52 generalized eigenvalues, while 2-by-2 blocks of S will be "standard‐
53 ized" by making the corresponding elements of T have the form:
54 [ a 0 ]
55 [ 0 b ]
56
57 and the pair of corresponding 2-by-2 blocks in S and T will have a com‐
58 plex conjugate pair of generalized eigenvalues.
59
60
61
63 JOBVSL (input) CHARACTER*1
64 = 'N': do not compute the left Schur vectors;
65 = 'V': compute the left Schur vectors.
66
67 JOBVSR (input) CHARACTER*1
68 = 'N': do not compute the right Schur vectors;
69 = 'V': compute the right Schur vectors.
70
71 SORT (input) CHARACTER*1
72 Specifies whether or not to order the eigenvalues on the diago‐
73 nal of the generalized Schur form. = 'N': Eigenvalues are not
74 ordered;
75 = 'S': Eigenvalues are ordered (see SELCTG);
76
77 SELCTG (external procedure) LOGICAL FUNCTION of three REAL arguments
78 SELCTG must be declared EXTERNAL in the calling subroutine. If
79 SORT = 'N', SELCTG is not referenced. If SORT = 'S', SELCTG is
80 used to select eigenvalues to sort to the top left of the Schur
81 form. An eigenvalue (ALPHAR(j)+ALPHAI(j))/BETA(j) is selected
82 if SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) is true; i.e. if either
83 one of a complex conjugate pair of eigenvalues is selected,
84 then both complex eigenvalues are selected.
85
86 Note that in the ill-conditioned case, a selected complex ei‐
87 genvalue may no longer satisfy SELCTG(ALPHAR(j),ALPHAI(j),
88 BETA(j)) = .TRUE. after ordering. INFO is to be set to N+2 in
89 this case.
90
91 N (input) INTEGER
92 The order of the matrices A, B, VSL, and VSR. N >= 0.
93
94 A (input/output) REAL array, dimension (LDA, N)
95 On entry, the first of the pair of matrices. On exit, A has
96 been overwritten by its generalized Schur form S.
97
98 LDA (input) INTEGER
99 The leading dimension of A. LDA >= max(1,N).
100
101 B (input/output) REAL array, dimension (LDB, N)
102 On entry, the second of the pair of matrices. On exit, B has
103 been overwritten by its generalized Schur form T.
104
105 LDB (input) INTEGER
106 The leading dimension of B. LDB >= max(1,N).
107
108 SDIM (output) INTEGER
109 If SORT = 'N', SDIM = 0. If SORT = 'S', SDIM = number of ei‐
110 genvalues (after sorting) for which SELCTG is true. (Complex
111 conjugate pairs for which SELCTG is true for either eigenvalue
112 count as 2.)
113
114 ALPHAR (output) REAL array, dimension (N)
115 ALPHAI (output) REAL array, dimension (N) BETA (output)
116 REAL array, dimension (N) On exit, (ALPHAR(j) +
117 ALPHAI(j)*i)/BETA(j), j=1,...,N, will be the generalized eigen‐
118 values. ALPHAR(j) + ALPHAI(j)*i, and BETA(j),j=1,...,N are
119 the diagonals of the complex Schur form (S,T) that would result
120 if the 2-by-2 diagonal blocks of the real Schur form of (A,B)
121 were further reduced to triangular form using 2-by-2 complex
122 unitary transformations. If ALPHAI(j) is zero, then the j-th
123 eigenvalue is real; if positive, then the j-th and (j+1)-st ei‐
124 genvalues are a complex conjugate pair, with ALPHAI(j+1) nega‐
125 tive.
126
127 Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j) may
128 easily over- or underflow, and BETA(j) may even be zero. Thus,
129 the user should avoid naively computing the ratio. However,
130 ALPHAR and ALPHAI will be always less than and usually compara‐
131 ble with norm(A) in magnitude, and BETA always less than and
132 usually comparable with norm(B).
133
134 VSL (output) REAL array, dimension (LDVSL,N)
135 If JOBVSL = 'V', VSL will contain the left Schur vectors. Not
136 referenced if JOBVSL = 'N'.
137
138 LDVSL (input) INTEGER
139 The leading dimension of the matrix VSL. LDVSL >=1, and if JOB‐
140 VSL = 'V', LDVSL >= N.
141
142 VSR (output) REAL array, dimension (LDVSR,N)
143 If JOBVSR = 'V', VSR will contain the right Schur vectors. Not
144 referenced if JOBVSR = 'N'.
145
146 LDVSR (input) INTEGER
147 The leading dimension of the matrix VSR. LDVSR >= 1, and if
148 JOBVSR = 'V', LDVSR >= N.
149
150 WORK (workspace/output) REAL array, dimension (MAX(1,LWORK))
151 On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
152
153 LWORK (input) INTEGER
154 The dimension of the array WORK. If N = 0, LWORK >= 1, else
155 LWORK >= max(8*N,6*N+16). For good performance , LWORK must
156 generally be larger.
157
158 If LWORK = -1, then a workspace query is assumed; the routine
159 only calculates the optimal size of the WORK array, returns
160 this value as the first entry of the WORK array, and no error
161 message related to LWORK is issued by XERBLA.
162
163 BWORK (workspace) LOGICAL array, dimension (N)
164 Not referenced if SORT = 'N'.
165
166 INFO (output) INTEGER
167 = 0: successful exit
168 < 0: if INFO = -i, the i-th argument had an illegal value.
169 = 1,...,N: The QZ iteration failed. (A,B) are not in Schur
170 form, but ALPHAR(j), ALPHAI(j), and BETA(j) should be correct
171 for j=INFO+1,...,N. > N: =N+1: other than QZ iteration failed
172 in SHGEQZ.
173 =N+2: after reordering, roundoff changed values of some complex
174 eigenvalues so that leading eigenvalues in the Generalized
175 Schur form no longer satisfy SELCTG=.TRUE. This could also be
176 caused due to scaling. =N+3: reordering failed in STGSEN.
177
178
179
180 LAPACK driver routine (version 3.N1o)vember 2006 SGGES(1)