File: stgsja

package info (click to toggle)
ruby-lapack 1.8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 28,572 kB
  • sloc: ansic: 191,612; ruby: 3,937; makefile: 6
file content (343 lines) | stat: -rw-r--r-- 11,162 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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
--- 
:name: stgsja
:md5sum: 604149ded91900c1bd601ad488246cc2
:category: :subroutine
:arguments: 
- jobu: 
    :type: char
    :intent: input
- jobv: 
    :type: char
    :intent: input
- jobq: 
    :type: char
    :intent: input
- m: 
    :type: integer
    :intent: input
- p: 
    :type: integer
    :intent: input
- n: 
    :type: integer
    :intent: input
- k: 
    :type: integer
    :intent: input
- l: 
    :type: integer
    :intent: input
- a: 
    :type: real
    :intent: input/output
    :dims: 
    - lda
    - n
- lda: 
    :type: integer
    :intent: input
- b: 
    :type: real
    :intent: input/output
    :dims: 
    - ldb
    - n
- ldb: 
    :type: integer
    :intent: input
- tola: 
    :type: real
    :intent: input
- tolb: 
    :type: real
    :intent: input
- alpha: 
    :type: real
    :intent: output
    :dims: 
    - n
- beta: 
    :type: real
    :intent: output
    :dims: 
    - n
- u: 
    :type: real
    :intent: input/output
    :dims: 
    - ldu
    - m
- ldu: 
    :type: integer
    :intent: input
- v: 
    :type: real
    :intent: input/output
    :dims: 
    - ldv
    - p
- ldv: 
    :type: integer
    :intent: input
- q: 
    :type: real
    :intent: input/output
    :dims: 
    - ldq
    - n
- ldq: 
    :type: integer
    :intent: input
- work: 
    :type: real
    :intent: workspace
    :dims: 
    - 2*n
- ncycle: 
    :type: integer
    :intent: output
- info: 
    :type: integer
    :intent: output
:substitutions: {}

:fortran_help: "      SUBROUTINE STGSJA( JOBU, JOBV, JOBQ, M, P, N, K, L, A, LDA, B, LDB, TOLA, TOLB, ALPHA, BETA, U, LDU, V, LDV, Q, LDQ, WORK, NCYCLE, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  STGSJA computes the generalized singular value decomposition (GSVD)\n\
  *  of two real upper triangular (or trapezoidal) matrices A and B.\n\
  *\n\
  *  On entry, it is assumed that matrices A and B have the following\n\
  *  forms, which may be obtained by the preprocessing subroutine SGGSVP\n\
  *  from a general M-by-N matrix A and P-by-N matrix B:\n\
  *\n\
  *               N-K-L  K    L\n\
  *     A =    K ( 0    A12  A13 ) if M-K-L >= 0;\n\
  *            L ( 0     0   A23 )\n\
  *        M-K-L ( 0     0    0  )\n\
  *\n\
  *             N-K-L  K    L\n\
  *     A =  K ( 0    A12  A13 ) if M-K-L < 0;\n\
  *        M-K ( 0     0   A23 )\n\
  *\n\
  *             N-K-L  K    L\n\
  *     B =  L ( 0     0   B13 )\n\
  *        P-L ( 0     0    0  )\n\
  *\n\
  *  where the K-by-K matrix A12 and L-by-L matrix B13 are nonsingular\n\
  *  upper triangular; A23 is L-by-L upper triangular if M-K-L >= 0,\n\
  *  otherwise A23 is (M-K)-by-L upper trapezoidal.\n\
  *\n\
  *  On exit,\n\
  *\n\
  *              U'*A*Q = D1*( 0 R ),    V'*B*Q = D2*( 0 R ),\n\
  *\n\
  *  where U, V and Q are orthogonal matrices, Z' denotes the transpose\n\
  *  of Z, R is a nonsingular upper triangular matrix, and D1 and D2 are\n\
  *  ``diagonal'' matrices, which are of the following structures:\n\
  *\n\
  *  If M-K-L >= 0,\n\
  *\n\
  *                      K  L\n\
  *         D1 =     K ( I  0 )\n\
  *                  L ( 0  C )\n\
  *              M-K-L ( 0  0 )\n\
  *\n\
  *                    K  L\n\
  *         D2 = L   ( 0  S )\n\
  *              P-L ( 0  0 )\n\
  *\n\
  *                 N-K-L  K    L\n\
  *    ( 0 R ) = K (  0   R11  R12 ) K\n\
  *              L (  0    0   R22 ) L\n\
  *\n\
  *  where\n\
  *\n\
  *    C = diag( ALPHA(K+1), ... , ALPHA(K+L) ),\n\
  *    S = diag( BETA(K+1),  ... , BETA(K+L) ),\n\
  *    C**2 + S**2 = I.\n\
  *\n\
  *    R is stored in A(1:K+L,N-K-L+1:N) on exit.\n\
  *\n\
  *  If M-K-L < 0,\n\
  *\n\
  *                 K M-K K+L-M\n\
  *      D1 =   K ( I  0    0   )\n\
  *           M-K ( 0  C    0   )\n\
  *\n\
  *                   K M-K K+L-M\n\
  *      D2 =   M-K ( 0  S    0   )\n\
  *           K+L-M ( 0  0    I   )\n\
  *             P-L ( 0  0    0   )\n\
  *\n\
  *                 N-K-L  K   M-K  K+L-M\n\
  * ( 0 R ) =    K ( 0    R11  R12  R13  )\n\
  *            M-K ( 0     0   R22  R23  )\n\
  *          K+L-M ( 0     0    0   R33  )\n\
  *\n\
  *  where\n\
  *  C = diag( ALPHA(K+1), ... , ALPHA(M) ),\n\
  *  S = diag( BETA(K+1),  ... , BETA(M) ),\n\
  *  C**2 + S**2 = I.\n\
  *\n\
  *  R = ( R11 R12 R13 ) is stored in A(1:M, N-K-L+1:N) and R33 is stored\n\
  *      (  0  R22 R23 )\n\
  *  in B(M-K+1:L,N+M-K-L+1:N) on exit.\n\
  *\n\
  *  The computation of the orthogonal transformation matrices U, V or Q\n\
  *  is optional.  These matrices may either be formed explicitly, or they\n\
  *  may be postmultiplied into input matrices U1, V1, or Q1.\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  JOBU    (input) CHARACTER*1\n\
  *          = 'U':  U must contain an orthogonal matrix U1 on entry, and\n\
  *                  the product U1*U is returned;\n\
  *          = 'I':  U is initialized to the unit matrix, and the\n\
  *                  orthogonal matrix U is returned;\n\
  *          = 'N':  U is not computed.\n\
  *\n\
  *  JOBV    (input) CHARACTER*1\n\
  *          = 'V':  V must contain an orthogonal matrix V1 on entry, and\n\
  *                  the product V1*V is returned;\n\
  *          = 'I':  V is initialized to the unit matrix, and the\n\
  *                  orthogonal matrix V is returned;\n\
  *          = 'N':  V is not computed.\n\
  *\n\
  *  JOBQ    (input) CHARACTER*1\n\
  *          = 'Q':  Q must contain an orthogonal matrix Q1 on entry, and\n\
  *                  the product Q1*Q is returned;\n\
  *          = 'I':  Q is initialized to the unit matrix, and the\n\
  *                  orthogonal matrix Q is returned;\n\
  *          = 'N':  Q is not computed.\n\
  *\n\
  *  M       (input) INTEGER\n\
  *          The number of rows of the matrix A.  M >= 0.\n\
  *\n\
  *  P       (input) INTEGER\n\
  *          The number of rows of the matrix B.  P >= 0.\n\
  *\n\
  *  N       (input) INTEGER\n\
  *          The number of columns of the matrices A and B.  N >= 0.\n\
  *\n\
  *  K       (input) INTEGER\n\
  *  L       (input) INTEGER\n\
  *          K and L specify the subblocks in the input matrices A and B:\n\
  *          A23 = A(K+1:MIN(K+L,M),N-L+1:N) and B13 = B(1:L,N-L+1:N)\n\
  *          of A and B, whose GSVD is going to be computed by STGSJA.\n\
  *          See Further Details.\n\
  *\n\
  *  A       (input/output) REAL array, dimension (LDA,N)\n\
  *          On entry, the M-by-N matrix A.\n\
  *          On exit, A(N-K+1:N,1:MIN(K+L,M) ) contains the triangular\n\
  *          matrix R or part of R.  See Purpose for details.\n\
  *\n\
  *  LDA     (input) INTEGER\n\
  *          The leading dimension of the array A. LDA >= max(1,M).\n\
  *\n\
  *  B       (input/output) REAL array, dimension (LDB,N)\n\
  *          On entry, the P-by-N matrix B.\n\
  *          On exit, if necessary, B(M-K+1:L,N+M-K-L+1:N) contains\n\
  *          a part of R.  See Purpose for details.\n\
  *\n\
  *  LDB     (input) INTEGER\n\
  *          The leading dimension of the array B. LDB >= max(1,P).\n\
  *\n\
  *  TOLA    (input) REAL\n\
  *  TOLB    (input) REAL\n\
  *          TOLA and TOLB are the convergence criteria for the Jacobi-\n\
  *          Kogbetliantz iteration procedure. Generally, they are the\n\
  *          same as used in the preprocessing step, say\n\
  *              TOLA = max(M,N)*norm(A)*MACHEPS,\n\
  *              TOLB = max(P,N)*norm(B)*MACHEPS.\n\
  *\n\
  *  ALPHA   (output) REAL array, dimension (N)\n\
  *  BETA    (output) REAL array, dimension (N)\n\
  *          On exit, ALPHA and BETA contain the generalized singular\n\
  *          value pairs of A and B;\n\
  *            ALPHA(1:K) = 1,\n\
  *            BETA(1:K)  = 0,\n\
  *          and if M-K-L >= 0,\n\
  *            ALPHA(K+1:K+L) = diag(C),\n\
  *            BETA(K+1:K+L)  = diag(S),\n\
  *          or if M-K-L < 0,\n\
  *            ALPHA(K+1:M)= C, ALPHA(M+1:K+L)= 0\n\
  *            BETA(K+1:M) = S, BETA(M+1:K+L) = 1.\n\
  *          Furthermore, if K+L < N,\n\
  *            ALPHA(K+L+1:N) = 0 and\n\
  *            BETA(K+L+1:N)  = 0.\n\
  *\n\
  *  U       (input/output) REAL array, dimension (LDU,M)\n\
  *          On entry, if JOBU = 'U', U must contain a matrix U1 (usually\n\
  *          the orthogonal matrix returned by SGGSVP).\n\
  *          On exit,\n\
  *          if JOBU = 'I', U contains the orthogonal matrix U;\n\
  *          if JOBU = 'U', U contains the product U1*U.\n\
  *          If JOBU = 'N', U is not referenced.\n\
  *\n\
  *  LDU     (input) INTEGER\n\
  *          The leading dimension of the array U. LDU >= max(1,M) if\n\
  *          JOBU = 'U'; LDU >= 1 otherwise.\n\
  *\n\
  *  V       (input/output) REAL array, dimension (LDV,P)\n\
  *          On entry, if JOBV = 'V', V must contain a matrix V1 (usually\n\
  *          the orthogonal matrix returned by SGGSVP).\n\
  *          On exit,\n\
  *          if JOBV = 'I', V contains the orthogonal matrix V;\n\
  *          if JOBV = 'V', V contains the product V1*V.\n\
  *          If JOBV = 'N', V is not referenced.\n\
  *\n\
  *  LDV     (input) INTEGER\n\
  *          The leading dimension of the array V. LDV >= max(1,P) if\n\
  *          JOBV = 'V'; LDV >= 1 otherwise.\n\
  *\n\
  *  Q       (input/output) REAL array, dimension (LDQ,N)\n\
  *          On entry, if JOBQ = 'Q', Q must contain a matrix Q1 (usually\n\
  *          the orthogonal matrix returned by SGGSVP).\n\
  *          On exit,\n\
  *          if JOBQ = 'I', Q contains the orthogonal matrix Q;\n\
  *          if JOBQ = 'Q', Q contains the product Q1*Q.\n\
  *          If JOBQ = 'N', Q is not referenced.\n\
  *\n\
  *  LDQ     (input) INTEGER\n\
  *          The leading dimension of the array Q. LDQ >= max(1,N) if\n\
  *          JOBQ = 'Q'; LDQ >= 1 otherwise.\n\
  *\n\
  *  WORK    (workspace) REAL array, dimension (2*N)\n\
  *\n\
  *  NCYCLE  (output) INTEGER\n\
  *          The number of cycles required for convergence.\n\
  *\n\
  *  INFO    (output) INTEGER\n\
  *          = 0:  successful exit\n\
  *          < 0:  if INFO = -i, the i-th argument had an illegal value.\n\
  *          = 1:  the procedure does not converge after MAXIT cycles.\n\
  *\n\
  *  Internal Parameters\n\
  *  ===================\n\
  *\n\
  *  MAXIT   INTEGER\n\
  *          MAXIT specifies the total loops that the iterative procedure\n\
  *          may take. If after MAXIT cycles, the routine fails to\n\
  *          converge, we return INFO = 1.\n\
  *\n\n\
  *  Further Details\n\
  *  ===============\n\
  *\n\
  *  STGSJA essentially uses a variant of Kogbetliantz algorithm to reduce\n\
  *  min(L,M-K)-by-L triangular (or trapezoidal) matrix A23 and L-by-L\n\
  *  matrix B13 to the form:\n\
  *\n\
  *           U1'*A13*Q1 = C1*R1; V1'*B13*Q1 = S1*R1,\n\
  *\n\
  *  where U1, V1 and Q1 are orthogonal matrix, and Z' is the transpose\n\
  *  of Z.  C1 and S1 are diagonal matrices satisfying\n\
  *\n\
  *                C1**2 + S1**2 = I,\n\
  *\n\
  *  and R1 is an L-by-L nonsingular upper triangular matrix.\n\
  *\n\
  *  =====================================================================\n\
  *\n"