1CTREVC(1) LAPACK routine (version 3.2) CTREVC(1)
2
3
4
6 CTREVC - computes some or all of the right and/or left eigenvectors of
7 a complex upper triangular matrix T
8
10 SUBROUTINE CTREVC( SIDE, HOWMNY, SELECT, N, T, LDT, VL, LDVL, VR, LDVR,
11 MM, M, WORK, RWORK, INFO )
12
13 CHARACTER HOWMNY, SIDE
14
15 INTEGER INFO, LDT, LDVL, LDVR, M, MM, N
16
17 LOGICAL SELECT( * )
18
19 REAL RWORK( * )
20
21 COMPLEX T( LDT, * ), VL( LDVL, * ), VR( LDVR, * ), WORK( * )
22
24 CTREVC computes some or all of the right and/or left eigenvectors of a
25 complex upper triangular matrix T. Matrices of this type are produced
26 by the Schur factorization of a complex general matrix: A = Q*T*Q**H,
27 as computed by CHSEQR.
28 The right eigenvector x and the left eigenvector y of T corresponding
29 to an eigenvalue w are defined by:
30 T*x = w*x, (y**H)*T = w*(y**H)
31 where y**H denotes the conjugate transpose of the vector y. The eigen‐
32 values are not input to this routine, but are read directly from the
33 diagonal of T.
34 This routine returns the matrices X and/or Y of right and left eigen‐
35 vectors of T, or the products Q*X and/or Q*Y, where Q is an input
36 matrix. If Q is the unitary factor that reduces a matrix A to Schur
37 form T, then Q*X and Q*Y are the matrices of right and left eigenvec‐
38 tors of A.
39
41 SIDE (input) CHARACTER*1
42 = 'R': compute right eigenvectors only;
43 = 'L': compute left eigenvectors only;
44 = 'B': compute both right and left eigenvectors.
45
46 HOWMNY (input) CHARACTER*1
47 = 'A': compute all right and/or left eigenvectors;
48 = 'B': compute all right and/or left eigenvectors, backtrans‐
49 formed using the matrices supplied in VR and/or VL; = 'S':
50 compute selected right and/or left eigenvectors, as indicated
51 by the logical array SELECT.
52
53 SELECT (input) LOGICAL array, dimension (N)
54 If HOWMNY = 'S', SELECT specifies the eigenvectors to be com‐
55 puted. The eigenvector corresponding to the j-th eigenvalue is
56 computed if SELECT(j) = .TRUE.. Not referenced if HOWMNY = 'A'
57 or 'B'.
58
59 N (input) INTEGER
60 The order of the matrix T. N >= 0.
61
62 T (input/output) COMPLEX array, dimension (LDT,N)
63 The upper triangular matrix T. T is modified, but restored on
64 exit.
65
66 LDT (input) INTEGER
67 The leading dimension of the array T. LDT >= max(1,N).
68
69 VL (input/output) COMPLEX array, dimension (LDVL,MM)
70 On entry, if SIDE = 'L' or 'B' and HOWMNY = 'B', VL must con‐
71 tain an N-by-N matrix Q (usually the unitary matrix Q of Schur
72 vectors returned by CHSEQR). On exit, if SIDE = 'L' or 'B', VL
73 contains: if HOWMNY = 'A', the matrix Y of left eigenvectors of
74 T; if HOWMNY = 'B', the matrix Q*Y; if HOWMNY = 'S', the left
75 eigenvectors of T specified by SELECT, stored consecutively in
76 the columns of VL, in the same order as their eigenvalues. Not
77 referenced if SIDE = 'R'.
78
79 LDVL (input) INTEGER
80 The leading dimension of the array VL. LDVL >= 1, and if SIDE
81 = 'L' or 'B', LDVL >= N.
82
83 VR (input/output) COMPLEX array, dimension (LDVR,MM)
84 On entry, if SIDE = 'R' or 'B' and HOWMNY = 'B', VR must con‐
85 tain an N-by-N matrix Q (usually the unitary matrix Q of Schur
86 vectors returned by CHSEQR). On exit, if SIDE = 'R' or 'B', VR
87 contains: if HOWMNY = 'A', the matrix X of right eigenvectors
88 of T; if HOWMNY = 'B', the matrix Q*X; if HOWMNY = 'S', the
89 right eigenvectors of T specified by SELECT, stored consecu‐
90 tively in the columns of VR, in the same order as their eigen‐
91 values. Not referenced if SIDE = 'L'.
92
93 LDVR (input) INTEGER
94 The leading dimension of the array VR. LDVR >= 1, and if SIDE
95 = 'R' or 'B'; LDVR >= N.
96
97 MM (input) INTEGER
98 The number of columns in the arrays VL and/or VR. MM >= M.
99
100 M (output) INTEGER
101 The number of columns in the arrays VL and/or VR actually used
102 to store the eigenvectors. If HOWMNY = 'A' or 'B', M is set to
103 N. Each selected eigenvector occupies one column.
104
105 WORK (workspace) COMPLEX array, dimension (2*N)
106
107 RWORK (workspace) REAL array, dimension (N)
108
109 INFO (output) INTEGER
110 = 0: successful exit
111 < 0: if INFO = -i, the i-th argument had an illegal value
112
114 The algorithm used in this program is basically backward (forward) sub‐
115 stitution, with scaling to make the the code robust against possible
116 overflow.
117 Each eigenvector is normalized so that the element of largest magnitude
118 has magnitude 1; here the magnitude of a complex number (x,y) is taken
119 to be |x| + |y|.
120
121
122
123 LAPACK routine (version 3.2) November 2008 CTREVC(1)