1SGEES(1) LAPACK driver routine (version 3.1) SGEES(1)
2
3
4
6 SGEES - for an N-by-N real nonsymmetric matrix A, the eigenvalues, the
7 real Schur form T, and, optionally, the matrix of Schur vectors Z
8
10 SUBROUTINE SGEES( JOBVS, SORT, SELECT, N, A, LDA, SDIM, WR, WI, VS,
11 LDVS, WORK, LWORK, BWORK, INFO )
12
13 CHARACTER JOBVS, SORT
14
15 INTEGER INFO, LDA, LDVS, LWORK, N, SDIM
16
17 LOGICAL BWORK( * )
18
19 REAL A( LDA, * ), VS( LDVS, * ), WI( * ), WORK( * ), WR( *
20 )
21
22 LOGICAL SELECT
23
24 EXTERNAL SELECT
25
27 SGEES computes for an N-by-N real nonsymmetric matrix A, the eigenval‐
28 ues, the real Schur form T, and, optionally, the matrix of Schur vec‐
29 tors Z. This gives the Schur factorization A = Z*T*(Z**T).
30
31 Optionally, it also orders the eigenvalues on the diagonal of the real
32 Schur form so that selected eigenvalues are at the top left. The lead‐
33 ing columns of Z then form an orthonormal basis for the invariant sub‐
34 space corresponding to the selected eigenvalues.
35
36 A matrix is in real Schur form if it is upper quasi-triangular with
37 1-by-1 and 2-by-2 blocks. 2-by-2 blocks will be standardized in the
38 form
39 [ a b ]
40 [ c a ]
41
42 where b*c < 0. The eigenvalues of such a block are a +- sqrt(bc).
43
44
46 JOBVS (input) CHARACTER*1
47 = 'N': Schur vectors are not computed;
48 = 'V': Schur vectors are computed.
49
50 SORT (input) CHARACTER*1
51 Specifies whether or not to order the eigenvalues on the diago‐
52 nal of the Schur form. = 'N': Eigenvalues are not ordered;
53 = 'S': Eigenvalues are ordered (see SELECT).
54
55 SELECT (external procedure) LOGICAL FUNCTION of two REAL arguments
56 SELECT must be declared EXTERNAL in the calling subroutine. If
57 SORT = 'S', SELECT is used to select eigenvalues to sort to the
58 top left of the Schur form. If SORT = 'N', SELECT is not ref‐
59 erenced. An eigenvalue WR(j)+sqrt(-1)*WI(j) is selected if
60 SELECT(WR(j),WI(j)) is true; i.e., if either one of a complex
61 conjugate pair of eigenvalues is selected, then both complex
62 eigenvalues are selected. Note that a selected complex eigen‐
63 value may no longer satisfy SELECT(WR(j),WI(j)) = .TRUE. after
64 ordering, since ordering may change the value of complex eigen‐
65 values (especially if the eigenvalue is ill-conditioned); in
66 this case INFO is set to N+2 (see INFO below).
67
68 N (input) INTEGER
69 The order of the matrix A. N >= 0.
70
71 A (input/output) REAL array, dimension (LDA,N)
72 On entry, the N-by-N matrix A. On exit, A has been overwritten
73 by its real Schur form T.
74
75 LDA (input) INTEGER
76 The leading dimension of the array A. LDA >= max(1,N).
77
78 SDIM (output) INTEGER
79 If SORT = 'N', SDIM = 0. If SORT = 'S', SDIM = number of ei‐
80 genvalues (after sorting) for which SELECT is true. (Complex
81 conjugate pairs for which SELECT is true for either eigenvalue
82 count as 2.)
83
84 WR (output) REAL array, dimension (N)
85 WI (output) REAL array, dimension (N) WR and WI contain
86 the real and imaginary parts, respectively, of the computed ei‐
87 genvalues in the same order that they appear on the diagonal of
88 the output Schur form T. Complex conjugate pairs of eigenval‐
89 ues will appear consecutively with the eigenvalue having the
90 positive imaginary part first.
91
92 VS (output) REAL array, dimension (LDVS,N)
93 If JOBVS = 'V', VS contains the orthogonal matrix Z of Schur
94 vectors. If JOBVS = 'N', VS is not referenced.
95
96 LDVS (input) INTEGER
97 The leading dimension of the array VS. LDVS >= 1; if JOBVS =
98 'V', LDVS >= N.
99
100 WORK (workspace/output) REAL array, dimension (MAX(1,LWORK))
101 On exit, if INFO = 0, WORK(1) contains the optimal LWORK.
102
103 LWORK (input) INTEGER
104 The dimension of the array WORK. LWORK >= max(1,3*N). For
105 good performance, LWORK must generally be larger.
106
107 If LWORK = -1, then a workspace query is assumed; the routine
108 only calculates the optimal size of the WORK array, returns
109 this value as the first entry of the WORK array, and no error
110 message related to LWORK is issued by XERBLA.
111
112 BWORK (workspace) LOGICAL array, dimension (N)
113 Not referenced if SORT = 'N'.
114
115 INFO (output) INTEGER
116 = 0: successful exit
117 < 0: if INFO = -i, the i-th argument had an illegal value.
118 > 0: if INFO = i, and i is
119 <= N: the QR algorithm failed to compute all the
120 eigenvalues; elements 1:ILO-1 and i+1:N of WR and WI contain
121 those eigenvalues which have converged; if JOBVS = 'V', VS con‐
122 tains the matrix which reduces A to its partially converged
123 Schur form. = N+1: the eigenvalues could not be reordered
124 because some eigenvalues were too close to separate (the prob‐
125 lem is very ill-conditioned); = N+2: after reordering, roundoff
126 changed values of some complex eigenvalues so that leading ei‐
127 genvalues in the Schur form no longer satisfy SELECT=.TRUE.
128 This could also be caused by underflow due to scaling.
129
130
131
132 LAPACK driver routine (version 3.N1o)vember 2006 SGEES(1)