File: cbbcsd

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 (297 lines) | stat: -rw-r--r-- 9,360 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
--- 
:name: cbbcsd
:md5sum: 7e10136e0faadfd9b81e31ecfe50ed65
:category: :subroutine
:arguments: 
- jobu1: 
    :type: char
    :intent: input
- jobu2: 
    :type: char
    :intent: input
- jobv1t: 
    :type: char
    :intent: input
- jobv2t: 
    :type: char
    :intent: input
- trans: 
    :type: char
    :intent: input
- m: 
    :type: integer
    :intent: input
- p: 
    :type: integer
    :intent: input
- q: 
    :type: integer
    :intent: input
- theta: 
    :type: real
    :intent: input/output
    :dims: 
    - q
- phi: 
    :type: real
    :intent: input
    :dims: 
    - q-1
- u1: 
    :type: complex
    :intent: input/output
    :dims: 
    - ldu1
    - p
- ldu1: 
    :type: integer
    :intent: input
- u2: 
    :type: complex
    :intent: input/output
    :dims: 
    - ldu2
    - m-p
- ldu2: 
    :type: integer
    :intent: input
- v1t: 
    :type: complex
    :intent: input/output
    :dims: 
    - ldv1t
    - q
- ldv1t: 
    :type: integer
    :intent: input
- v2t: 
    :type: complex
    :intent: input/output
    :dims: 
    - ldv2t
    - m-q
- ldv2t: 
    :type: integer
    :intent: input
- b11d: 
    :type: real
    :intent: output
    :dims: 
    - q
- b11e: 
    :type: real
    :intent: output
    :dims: 
    - q-1
- b12d: 
    :type: real
    :intent: output
    :dims: 
    - q
- b12e: 
    :type: real
    :intent: output
    :dims: 
    - q-1
- b21d: 
    :type: real
    :intent: output
    :dims: 
    - q
- b21e: 
    :type: real
    :intent: output
    :dims: 
    - q-1
- b22d: 
    :type: real
    :intent: output
    :dims: 
    - q
- b22e: 
    :type: real
    :intent: output
    :dims: 
    - q-1
- rwork: 
    :type: real
    :intent: workspace
    :dims: 
    - MAX(1,lrwork)
- lrwork: 
    :type: integer
    :intent: input
    :option: true
    :default: 8*q
- info: 
    :type: integer
    :intent: output
:substitutions: 
  lrwork: MAX(1,8*q)
:fortran_help: "      SUBROUTINE CBBCSD( JOBU1, JOBU2, JOBV1T, JOBV2T, TRANS, M, P, Q, THETA, PHI, U1, LDU1, U2, LDU2, V1T, LDV1T, V2T, LDV2T, B11D, B11E, B12D, B12E, B21D, B21E, B22D, B22E, RWORK, LRWORK, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  CBBCSD computes the CS decomposition of a unitary matrix in\n\
  *  bidiagonal-block form,\n\
  *\n\
  *\n\
  *      [ B11 | B12 0  0 ]\n\
  *      [  0  |  0 -I  0 ]\n\
  *  X = [----------------]\n\
  *      [ B21 | B22 0  0 ]\n\
  *      [  0  |  0  0  I ]\n\
  *\n\
  *                                [  C | -S  0  0 ]\n\
  *                    [ U1 |    ] [  0 |  0 -I  0 ] [ V1 |    ]**H\n\
  *                  = [---------] [---------------] [---------]   .\n\
  *                    [    | U2 ] [  S |  C  0  0 ] [    | V2 ]\n\
  *                                [  0 |  0  0  I ]\n\
  *\n\
  *  X is M-by-M, its top-left block is P-by-Q, and Q must be no larger\n\
  *  than P, M-P, or M-Q. (If Q is not the smallest index, then X must be\n\
  *  transposed and/or permuted. This can be done in constant time using\n\
  *  the TRANS and SIGNS options. See CUNCSD for details.)\n\
  *\n\
  *  The bidiagonal matrices B11, B12, B21, and B22 are represented\n\
  *  implicitly by angles THETA(1:Q) and PHI(1:Q-1).\n\
  *\n\
  *  The unitary matrices U1, U2, V1T, and V2T are input/output.\n\
  *  The input matrices are pre- or post-multiplied by the appropriate\n\
  *  singular vector matrices.\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  JOBU1   (input) CHARACTER\n\
  *          = 'Y':      U1 is updated;\n\
  *          otherwise:  U1 is not updated.\n\
  *\n\
  *  JOBU2   (input) CHARACTER\n\
  *          = 'Y':      U2 is updated;\n\
  *          otherwise:  U2 is not updated.\n\
  *\n\
  *  JOBV1T  (input) CHARACTER\n\
  *          = 'Y':      V1T is updated;\n\
  *          otherwise:  V1T is not updated.\n\
  *\n\
  *  JOBV2T  (input) CHARACTER\n\
  *          = 'Y':      V2T is updated;\n\
  *          otherwise:  V2T is not updated.\n\
  *\n\
  *  TRANS   (input) CHARACTER\n\
  *          = 'T':      X, U1, U2, V1T, and V2T are stored in row-major\n\
  *                      order;\n\
  *          otherwise:  X, U1, U2, V1T, and V2T are stored in column-\n\
  *                      major order.\n\
  *\n\
  *  M       (input) INTEGER\n\
  *          The number of rows and columns in X, the unitary matrix in\n\
  *          bidiagonal-block form.\n\
  *\n\
  *  P       (input) INTEGER\n\
  *          The number of rows in the top-left block of X. 0 <= P <= M.\n\
  *\n\
  *  Q       (input) INTEGER\n\
  *          The number of columns in the top-left block of X.\n\
  *          0 <= Q <= MIN(P,M-P,M-Q).\n\
  *\n\
  *  THETA   (input/output) REAL array, dimension (Q)\n\
  *          On entry, the angles THETA(1),...,THETA(Q) that, along with\n\
  *          PHI(1), ...,PHI(Q-1), define the matrix in bidiagonal-block\n\
  *          form. On exit, the angles whose cosines and sines define the\n\
  *          diagonal blocks in the CS decomposition.\n\
  *\n\
  *  PHI     (input/workspace) REAL array, dimension (Q-1)\n\
  *          The angles PHI(1),...,PHI(Q-1) that, along with THETA(1),...,\n\
  *          THETA(Q), define the matrix in bidiagonal-block form.\n\
  *\n\
  *  U1      (input/output) COMPLEX array, dimension (LDU1,P)\n\
  *          On entry, an LDU1-by-P matrix. On exit, U1 is postmultiplied\n\
  *          by the left singular vector matrix common to [ B11 ; 0 ] and\n\
  *          [ B12 0 0 ; 0 -I 0 0 ].\n\
  *\n\
  *  LDU1    (input) INTEGER\n\
  *          The leading dimension of the array U1.\n\
  *\n\
  *  U2      (input/output) COMPLEX array, dimension (LDU2,M-P)\n\
  *          On entry, an LDU2-by-(M-P) matrix. On exit, U2 is\n\
  *          postmultiplied by the left singular vector matrix common to\n\
  *          [ B21 ; 0 ] and [ B22 0 0 ; 0 0 I ].\n\
  *\n\
  *  LDU2    (input) INTEGER\n\
  *          The leading dimension of the array U2.\n\
  *\n\
  *  V1T     (input/output) COMPLEX array, dimension (LDV1T,Q)\n\
  *          On entry, a LDV1T-by-Q matrix. On exit, V1T is premultiplied\n\
  *          by the conjugate transpose of the right singular vector\n\
  *          matrix common to [ B11 ; 0 ] and [ B21 ; 0 ].\n\
  *\n\
  *  LDV1T   (input) INTEGER\n\
  *          The leading dimension of the array V1T.\n\
  *\n\
  *  V2T     (input/output) COMPLEX array, dimenison (LDV2T,M-Q)\n\
  *          On entry, a LDV2T-by-(M-Q) matrix. On exit, V2T is\n\
  *          premultiplied by the conjugate transpose of the right\n\
  *          singular vector matrix common to [ B12 0 0 ; 0 -I 0 ] and\n\
  *          [ B22 0 0 ; 0 0 I ].\n\
  *\n\
  *  LDV2T   (input) INTEGER\n\
  *          The leading dimension of the array V2T.\n\
  *\n\
  *  B11D    (output) REAL array, dimension (Q)\n\
  *          When CBBCSD converges, B11D contains the cosines of THETA(1),\n\
  *          ..., THETA(Q). If CBBCSD fails to converge, then B11D\n\
  *          contains the diagonal of the partially reduced top-left\n\
  *          block.\n\
  *\n\
  *  B11E    (output) REAL array, dimension (Q-1)\n\
  *          When CBBCSD converges, B11E contains zeros. If CBBCSD fails\n\
  *          to converge, then B11E contains the superdiagonal of the\n\
  *          partially reduced top-left block.\n\
  *\n\
  *  B12D    (output) REAL array, dimension (Q)\n\
  *          When CBBCSD converges, B12D contains the negative sines of\n\
  *          THETA(1), ..., THETA(Q). If CBBCSD fails to converge, then\n\
  *          B12D contains the diagonal of the partially reduced top-right\n\
  *          block.\n\
  *\n\
  *  B12E    (output) REAL array, dimension (Q-1)\n\
  *          When CBBCSD converges, B12E contains zeros. If CBBCSD fails\n\
  *          to converge, then B12E contains the subdiagonal of the\n\
  *          partially reduced top-right block.\n\
  *\n\
  *  RWORK   (workspace) REAL array, dimension (MAX(1,LWORK))\n\
  *          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.\n\
  *\n\
  *  LRWORK  (input) INTEGER\n\
  *          The dimension of the array RWORK. LRWORK >= MAX(1,8*Q).\n\
  *\n\
  *          If LRWORK = -1, then a workspace query is assumed; the\n\
  *          routine only calculates the optimal size of the RWORK array,\n\
  *          returns this value as the first entry of the work array, and\n\
  *          no error message related to LRWORK is issued by XERBLA.\n\
  *\n\
  *  INFO    (output) INTEGER\n\
  *          = 0:  successful exit.\n\
  *          < 0:  if INFO = -i, the i-th argument had an illegal value.\n\
  *          > 0:  if CBBCSD did not converge, INFO specifies the number\n\
  *                of nonzero entries in PHI, and B11D, B11E, etc.,\n\
  *                contain the partially reduced matrix.\n\
  *\n\
  *  Reference\n\
  *  =========\n\
  *\n\
  *  [1] Brian D. Sutton. Computing the complete CS decomposition. Numer.\n\
  *      Algorithms, 50(1):33-65, 2009.\n\
  *\n\
  *  Internal Parameters\n\
  *  ===================\n\
  *\n\
  *  TOLMUL  REAL, default = MAX(10,MIN(100,EPS**(-1/8)))\n\
  *          TOLMUL controls the convergence criterion of the QR loop.\n\
  *          Angles THETA(i), PHI(i) are rounded to 0 or PI/2 when they\n\
  *          are within TOLMUL*EPS of either bound.\n\
  *\n\n\
  *  ===================================================================\n\
  *\n"