File: slasd2

package info (click to toggle)
ruby-lapack 1.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 29,304 kB
  • ctags: 3,419
  • sloc: ansic: 190,572; ruby: 3,937; makefile: 4
file content (254 lines) | stat: -rw-r--r-- 8,623 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
--- 
:name: slasd2
:md5sum: e139bb4b0237d0c44116e11595e1c166
:category: :subroutine
:arguments: 
- nl: 
    :type: integer
    :intent: input
- nr: 
    :type: integer
    :intent: input
- sqre: 
    :type: integer
    :intent: input
- k: 
    :type: integer
    :intent: output
- d: 
    :type: real
    :intent: input/output
    :dims: 
    - n
- z: 
    :type: real
    :intent: output
    :dims: 
    - n
- alpha: 
    :type: real
    :intent: input
- beta: 
    :type: real
    :intent: input
- u: 
    :type: real
    :intent: input/output
    :dims: 
    - ldu
    - n
- ldu: 
    :type: integer
    :intent: input
- vt: 
    :type: real
    :intent: input/output
    :dims: 
    - ldvt
    - m
- ldvt: 
    :type: integer
    :intent: input
- dsigma: 
    :type: real
    :intent: output
    :dims: 
    - n
- u2: 
    :type: real
    :intent: output
    :dims: 
    - ldu2
    - n
- ldu2: 
    :type: integer
    :intent: input
- vt2: 
    :type: real
    :intent: output
    :dims: 
    - ldvt2
    - n
- ldvt2: 
    :type: integer
    :intent: input
- idxp: 
    :type: integer
    :intent: workspace
    :dims: 
    - n
- idx: 
    :type: integer
    :intent: workspace
    :dims: 
    - n
- idxc: 
    :type: integer
    :intent: output
    :dims: 
    - n
- idxq: 
    :type: integer
    :intent: input/output
    :dims: 
    - n
- coltyp: 
    :type: integer
    :intent: output
    :dims: 
    - n
- info: 
    :type: integer
    :intent: output
:substitutions: 
  ldu2: n
  ldvt2: m
:fortran_help: "      SUBROUTINE SLASD2( NL, NR, SQRE, K, D, Z, ALPHA, BETA, U, LDU, VT, LDVT, DSIGMA, U2, LDU2, VT2, LDVT2, IDXP, IDX, IDXC, IDXQ, COLTYP, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  SLASD2 merges the two sets of singular values together into a single\n\
  *  sorted set.  Then it tries to deflate the size of the problem.\n\
  *  There are two ways in which deflation can occur:  when two or more\n\
  *  singular values are close together or if there is a tiny entry in the\n\
  *  Z vector.  For each such occurrence the order of the related secular\n\
  *  equation problem is reduced by one.\n\
  *\n\
  *  SLASD2 is called from SLASD1.\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  NL     (input) INTEGER\n\
  *         The row dimension of the upper block.  NL >= 1.\n\
  *\n\
  *  NR     (input) INTEGER\n\
  *         The row dimension of the lower block.  NR >= 1.\n\
  *\n\
  *  SQRE   (input) INTEGER\n\
  *         = 0: the lower block is an NR-by-NR square matrix.\n\
  *         = 1: the lower block is an NR-by-(NR+1) rectangular matrix.\n\
  *\n\
  *         The bidiagonal matrix has N = NL + NR + 1 rows and\n\
  *         M = N + SQRE >= N columns.\n\
  *\n\
  *  K      (output) INTEGER\n\
  *         Contains the dimension of the non-deflated matrix,\n\
  *         This is the order of the related secular equation. 1 <= K <=N.\n\
  *\n\
  *  D      (input/output) REAL array, dimension (N)\n\
  *         On entry D contains the singular values of the two submatrices\n\
  *         to be combined.  On exit D contains the trailing (N-K) updated\n\
  *         singular values (those which were deflated) sorted into\n\
  *         increasing order.\n\
  *\n\
  *  Z      (output) REAL array, dimension (N)\n\
  *         On exit Z contains the updating row vector in the secular\n\
  *         equation.\n\
  *\n\
  *  ALPHA  (input) REAL\n\
  *         Contains the diagonal element associated with the added row.\n\
  *\n\
  *  BETA   (input) REAL\n\
  *         Contains the off-diagonal element associated with the added\n\
  *         row.\n\
  *\n\
  *  U      (input/output) REAL array, dimension (LDU,N)\n\
  *         On entry U contains the left singular vectors of two\n\
  *         submatrices in the two square blocks with corners at (1,1),\n\
  *         (NL, NL), and (NL+2, NL+2), (N,N).\n\
  *         On exit U contains the trailing (N-K) updated left singular\n\
  *         vectors (those which were deflated) in its last N-K columns.\n\
  *\n\
  *  LDU    (input) INTEGER\n\
  *         The leading dimension of the array U.  LDU >= N.\n\
  *\n\
  *  VT     (input/output) REAL array, dimension (LDVT,M)\n\
  *         On entry VT' contains the right singular vectors of two\n\
  *         submatrices in the two square blocks with corners at (1,1),\n\
  *         (NL+1, NL+1), and (NL+2, NL+2), (M,M).\n\
  *         On exit VT' contains the trailing (N-K) updated right singular\n\
  *         vectors (those which were deflated) in its last N-K columns.\n\
  *         In case SQRE =1, the last row of VT spans the right null\n\
  *         space.\n\
  *\n\
  *  LDVT   (input) INTEGER\n\
  *         The leading dimension of the array VT.  LDVT >= M.\n\
  *\n\
  *  DSIGMA (output) REAL array, dimension (N)\n\
  *         Contains a copy of the diagonal elements (K-1 singular values\n\
  *         and one zero) in the secular equation.\n\
  *\n\
  *  U2     (output) REAL array, dimension (LDU2,N)\n\
  *         Contains a copy of the first K-1 left singular vectors which\n\
  *         will be used by SLASD3 in a matrix multiply (SGEMM) to solve\n\
  *         for the new left singular vectors. U2 is arranged into four\n\
  *         blocks. The first block contains a column with 1 at NL+1 and\n\
  *         zero everywhere else; the second block contains non-zero\n\
  *         entries only at and above NL; the third contains non-zero\n\
  *         entries only below NL+1; and the fourth is dense.\n\
  *\n\
  *  LDU2   (input) INTEGER\n\
  *         The leading dimension of the array U2.  LDU2 >= N.\n\
  *\n\
  *  VT2    (output) REAL array, dimension (LDVT2,N)\n\
  *         VT2' contains a copy of the first K right singular vectors\n\
  *         which will be used by SLASD3 in a matrix multiply (SGEMM) to\n\
  *         solve for the new right singular vectors. VT2 is arranged into\n\
  *         three blocks. The first block contains a row that corresponds\n\
  *         to the special 0 diagonal element in SIGMA; the second block\n\
  *         contains non-zeros only at and before NL +1; the third block\n\
  *         contains non-zeros only at and after  NL +2.\n\
  *\n\
  *  LDVT2  (input) INTEGER\n\
  *         The leading dimension of the array VT2.  LDVT2 >= M.\n\
  *\n\
  *  IDXP   (workspace) INTEGER array, dimension (N)\n\
  *         This will contain the permutation used to place deflated\n\
  *         values of D at the end of the array. On output IDXP(2:K)\n\
  *         points to the nondeflated D-values and IDXP(K+1:N)\n\
  *         points to the deflated singular values.\n\
  *\n\
  *  IDX    (workspace) INTEGER array, dimension (N)\n\
  *         This will contain the permutation used to sort the contents of\n\
  *         D into ascending order.\n\
  *\n\
  *  IDXC   (output) INTEGER array, dimension (N)\n\
  *         This will contain the permutation used to arrange the columns\n\
  *         of the deflated U matrix into three groups:  the first group\n\
  *         contains non-zero entries only at and above NL, the second\n\
  *         contains non-zero entries only below NL+2, and the third is\n\
  *         dense.\n\
  *\n\
  *  IDXQ   (input/output) INTEGER array, dimension (N)\n\
  *         This contains the permutation which separately sorts the two\n\
  *         sub-problems in D into ascending order.  Note that entries in\n\
  *         the first hlaf of this permutation must first be moved one\n\
  *         position backward; and entries in the second half\n\
  *         must first have NL+1 added to their values.\n\
  *\n\
  *  COLTYP (workspace/output) INTEGER array, dimension (N)\n\
  *         As workspace, this will contain a label which will indicate\n\
  *         which of the following types a column in the U2 matrix or a\n\
  *         row in the VT2 matrix is:\n\
  *         1 : non-zero in the upper half only\n\
  *         2 : non-zero in the lower half only\n\
  *         3 : dense\n\
  *         4 : deflated\n\
  *\n\
  *         On exit, it is an array of dimension 4, with COLTYP(I) being\n\
  *         the dimension of the I-th type columns.\n\
  *\n\
  *  INFO   (output) INTEGER\n\
  *          = 0:  successful exit.\n\
  *          < 0:  if INFO = -i, the i-th argument had an illegal value.\n\
  *\n\n\
  *  Further Details\n\
  *  ===============\n\
  *\n\
  *  Based on contributions by\n\
  *     Ming Gu and Huan Ren, Computer Science Division, University of\n\
  *     California at Berkeley, USA\n\
  *\n\
  *  =====================================================================\n\
  *\n"