File: dtgevc

package info (click to toggle)
ruby-lapack 1.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 28,552 kB
  • sloc: ansic: 191,612; ruby: 3,934; makefile: 8
file content (265 lines) | stat: -rwxr-xr-x 10,183 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
--- 
:name: dtgevc
:md5sum: 05c0ef877f01207c516547bdc1379d50
:category: :subroutine
:arguments: 
- side: 
    :type: char
    :intent: input
- howmny: 
    :type: char
    :intent: input
- select: 
    :type: logical
    :intent: input
    :dims: 
    - n
- n: 
    :type: integer
    :intent: input
- s: 
    :type: doublereal
    :intent: input
    :dims: 
    - lds
    - n
- lds: 
    :type: integer
    :intent: input
- p: 
    :type: doublereal
    :intent: input
    :dims: 
    - ldp
    - n
- ldp: 
    :type: integer
    :intent: input
- vl: 
    :type: doublereal
    :intent: input/output
    :dims: 
    - ldvl
    - mm
- ldvl: 
    :type: integer
    :intent: input
- vr: 
    :type: doublereal
    :intent: input/output
    :dims: 
    - ldvr
    - mm
- ldvr: 
    :type: integer
    :intent: input
- mm: 
    :type: integer
    :intent: input
- m: 
    :type: integer
    :intent: output
- work: 
    :type: doublereal
    :intent: workspace
    :dims: 
    - 6*n
- info: 
    :type: integer
    :intent: output
:substitutions: {}

:fortran_help: "      SUBROUTINE DTGEVC( SIDE, HOWMNY, SELECT, N, S, LDS, P, LDP, VL, LDVL, VR, LDVR, MM, M, WORK, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  DTGEVC computes some or all of the right and/or left eigenvectors of\n\
  *  a pair of real matrices (S,P), where S is a quasi-triangular matrix\n\
  *  and P is upper triangular.  Matrix pairs of this type are produced by\n\
  *  the generalized Schur factorization of a matrix pair (A,B):\n\
  *\n\
  *     A = Q*S*Z**T,  B = Q*P*Z**T\n\
  *\n\
  *  as computed by DGGHRD + DHGEQZ.\n\
  *\n\
  *  The right eigenvector x and the left eigenvector y of (S,P)\n\
  *  corresponding to an eigenvalue w are defined by:\n\
  *  \n\
  *     S*x = w*P*x,  (y**H)*S = w*(y**H)*P,\n\
  *  \n\
  *  where y**H denotes the conjugate tranpose of y.\n\
  *  The eigenvalues are not input to this routine, but are computed\n\
  *  directly from the diagonal blocks of S and P.\n\
  *  \n\
  *  This routine returns the matrices X and/or Y of right and left\n\
  *  eigenvectors of (S,P), or the products Z*X and/or Q*Y,\n\
  *  where Z and Q are input matrices.\n\
  *  If Q and Z are the orthogonal factors from the generalized Schur\n\
  *  factorization of a matrix pair (A,B), then Z*X and Q*Y\n\
  *  are the matrices of right and left eigenvectors of (A,B).\n\
  * \n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  SIDE    (input) CHARACTER*1\n\
  *          = 'R': compute right eigenvectors only;\n\
  *          = 'L': compute left eigenvectors only;\n\
  *          = 'B': compute both right and left eigenvectors.\n\
  *\n\
  *  HOWMNY  (input) CHARACTER*1\n\
  *          = 'A': compute all right and/or left eigenvectors;\n\
  *          = 'B': compute all right and/or left eigenvectors,\n\
  *                 backtransformed by the matrices in VR and/or VL;\n\
  *          = 'S': compute selected right and/or left eigenvectors,\n\
  *                 specified by the logical array SELECT.\n\
  *\n\
  *  SELECT  (input) LOGICAL array, dimension (N)\n\
  *          If HOWMNY='S', SELECT specifies the eigenvectors to be\n\
  *          computed.  If w(j) is a real eigenvalue, the corresponding\n\
  *          real eigenvector is computed if SELECT(j) is .TRUE..\n\
  *          If w(j) and w(j+1) are the real and imaginary parts of a\n\
  *          complex eigenvalue, the corresponding complex eigenvector\n\
  *          is computed if either SELECT(j) or SELECT(j+1) is .TRUE.,\n\
  *          and on exit SELECT(j) is set to .TRUE. and SELECT(j+1) is\n\
  *          set to .FALSE..\n\
  *          Not referenced if HOWMNY = 'A' or 'B'.\n\
  *\n\
  *  N       (input) INTEGER\n\
  *          The order of the matrices S and P.  N >= 0.\n\
  *\n\
  *  S       (input) DOUBLE PRECISION array, dimension (LDS,N)\n\
  *          The upper quasi-triangular matrix S from a generalized Schur\n\
  *          factorization, as computed by DHGEQZ.\n\
  *\n\
  *  LDS     (input) INTEGER\n\
  *          The leading dimension of array S.  LDS >= max(1,N).\n\
  *\n\
  *  P       (input) DOUBLE PRECISION array, dimension (LDP,N)\n\
  *          The upper triangular matrix P from a generalized Schur\n\
  *          factorization, as computed by DHGEQZ.\n\
  *          2-by-2 diagonal blocks of P corresponding to 2-by-2 blocks\n\
  *          of S must be in positive diagonal form.\n\
  *\n\
  *  LDP     (input) INTEGER\n\
  *          The leading dimension of array P.  LDP >= max(1,N).\n\
  *\n\
  *  VL      (input/output) DOUBLE PRECISION array, dimension (LDVL,MM)\n\
  *          On entry, if SIDE = 'L' or 'B' and HOWMNY = 'B', VL must\n\
  *          contain an N-by-N matrix Q (usually the orthogonal matrix Q\n\
  *          of left Schur vectors returned by DHGEQZ).\n\
  *          On exit, if SIDE = 'L' or 'B', VL contains:\n\
  *          if HOWMNY = 'A', the matrix Y of left eigenvectors of (S,P);\n\
  *          if HOWMNY = 'B', the matrix Q*Y;\n\
  *          if HOWMNY = 'S', the left eigenvectors of (S,P) specified by\n\
  *                      SELECT, stored consecutively in the columns of\n\
  *                      VL, in the same order as their eigenvalues.\n\
  *\n\
  *          A complex eigenvector corresponding to a complex eigenvalue\n\
  *          is stored in two consecutive columns, the first holding the\n\
  *          real part, and the second the imaginary part.\n\
  *\n\
  *          Not referenced if SIDE = 'R'.\n\
  *\n\
  *  LDVL    (input) INTEGER\n\
  *          The leading dimension of array VL.  LDVL >= 1, and if\n\
  *          SIDE = 'L' or 'B', LDVL >= N.\n\
  *\n\
  *  VR      (input/output) DOUBLE PRECISION array, dimension (LDVR,MM)\n\
  *          On entry, if SIDE = 'R' or 'B' and HOWMNY = 'B', VR must\n\
  *          contain an N-by-N matrix Z (usually the orthogonal matrix Z\n\
  *          of right Schur vectors returned by DHGEQZ).\n\
  *\n\
  *          On exit, if SIDE = 'R' or 'B', VR contains:\n\
  *          if HOWMNY = 'A', the matrix X of right eigenvectors of (S,P);\n\
  *          if HOWMNY = 'B' or 'b', the matrix Z*X;\n\
  *          if HOWMNY = 'S' or 's', the right eigenvectors of (S,P)\n\
  *                      specified by SELECT, stored consecutively in the\n\
  *                      columns of VR, in the same order as their\n\
  *                      eigenvalues.\n\
  *\n\
  *          A complex eigenvector corresponding to a complex eigenvalue\n\
  *          is stored in two consecutive columns, the first holding the\n\
  *          real part and the second the imaginary part.\n\
  *          \n\
  *          Not referenced if SIDE = 'L'.\n\
  *\n\
  *  LDVR    (input) INTEGER\n\
  *          The leading dimension of the array VR.  LDVR >= 1, and if\n\
  *          SIDE = 'R' or 'B', LDVR >= N.\n\
  *\n\
  *  MM      (input) INTEGER\n\
  *          The number of columns in the arrays VL and/or VR. MM >= M.\n\
  *\n\
  *  M       (output) INTEGER\n\
  *          The number of columns in the arrays VL and/or VR actually\n\
  *          used to store the eigenvectors.  If HOWMNY = 'A' or 'B', M\n\
  *          is set to N.  Each selected real eigenvector occupies one\n\
  *          column and each selected complex eigenvector occupies two\n\
  *          columns.\n\
  *\n\
  *  WORK    (workspace) DOUBLE PRECISION array, dimension (6*N)\n\
  *\n\
  *  INFO    (output) INTEGER\n\
  *          = 0:  successful exit.\n\
  *          < 0:  if INFO = -i, the i-th argument had an illegal value.\n\
  *          > 0:  the 2-by-2 block (INFO:INFO+1) does not have a complex\n\
  *                eigenvalue.\n\
  *\n\n\
  *  Further Details\n\
  *  ===============\n\
  *\n\
  *  Allocation of workspace:\n\
  *  ---------- -- ---------\n\
  *\n\
  *     WORK( j ) = 1-norm of j-th column of A, above the diagonal\n\
  *     WORK( N+j ) = 1-norm of j-th column of B, above the diagonal\n\
  *     WORK( 2*N+1:3*N ) = real part of eigenvector\n\
  *     WORK( 3*N+1:4*N ) = imaginary part of eigenvector\n\
  *     WORK( 4*N+1:5*N ) = real part of back-transformed eigenvector\n\
  *     WORK( 5*N+1:6*N ) = imaginary part of back-transformed eigenvector\n\
  *\n\
  *  Rowwise vs. columnwise solution methods:\n\
  *  ------- --  ---------- -------- -------\n\
  *\n\
  *  Finding a generalized eigenvector consists basically of solving the\n\
  *  singular triangular system\n\
  *\n\
  *   (A - w B) x = 0     (for right) or:   (A - w B)**H y = 0  (for left)\n\
  *\n\
  *  Consider finding the i-th right eigenvector (assume all eigenvalues\n\
  *  are real). The equation to be solved is:\n\
  *       n                   i\n\
  *  0 = sum  C(j,k) v(k)  = sum  C(j,k) v(k)     for j = i,. . .,1\n\
  *      k=j                 k=j\n\
  *\n\
  *  where  C = (A - w B)  (The components v(i+1:n) are 0.)\n\
  *\n\
  *  The \"rowwise\" method is:\n\
  *\n\
  *  (1)  v(i) := 1\n\
  *  for j = i-1,. . .,1:\n\
  *                          i\n\
  *      (2) compute  s = - sum C(j,k) v(k)   and\n\
  *                        k=j+1\n\
  *\n\
  *      (3) v(j) := s / C(j,j)\n\
  *\n\
  *  Step 2 is sometimes called the \"dot product\" step, since it is an\n\
  *  inner product between the j-th row and the portion of the eigenvector\n\
  *  that has been computed so far.\n\
  *\n\
  *  The \"columnwise\" method consists basically in doing the sums\n\
  *  for all the rows in parallel.  As each v(j) is computed, the\n\
  *  contribution of v(j) times the j-th column of C is added to the\n\
  *  partial sums.  Since FORTRAN arrays are stored columnwise, this has\n\
  *  the advantage that at each step, the elements of C that are accessed\n\
  *  are adjacent to one another, whereas with the rowwise method, the\n\
  *  elements accessed at a step are spaced LDS (and LDP) words apart.\n\
  *\n\
  *  When finding left eigenvectors, the matrix in question is the\n\
  *  transpose of the one in storage, so the rowwise method then\n\
  *  actually accesses columns of A and B at each step, and so is the\n\
  *  preferred method.\n\
  *\n\
  *  =====================================================================\n\
  *\n"