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
|
---
:name: slalsa
:md5sum: 3817ef103afe5374c5f2833dfd84f267
:category: :subroutine
:arguments:
- icompq:
:type: integer
:intent: input
- smlsiz:
:type: integer
:intent: input
- n:
:type: integer
:intent: input
- nrhs:
:type: integer
:intent: input
- b:
:type: real
:intent: input/output
:dims:
- ldb
- nrhs
- ldb:
:type: integer
:intent: input
- bx:
:type: real
:intent: output
:dims:
- ldbx
- nrhs
- ldbx:
:type: integer
:intent: input
- u:
:type: real
:intent: input
:dims:
- ldu
- smlsiz
- ldu:
:type: integer
:intent: input
- vt:
:type: real
:intent: input
:dims:
- ldu
- smlsiz+1
- k:
:type: integer
:intent: input
:dims:
- n
- difl:
:type: real
:intent: input
:dims:
- ldu
- nlvl
- difr:
:type: real
:intent: input
:dims:
- ldu
- 2 * nlvl
- z:
:type: real
:intent: input
:dims:
- ldu
- nlvl
- poles:
:type: real
:intent: input
:dims:
- ldu
- 2 * nlvl
- givptr:
:type: integer
:intent: input
:dims:
- n
- givcol:
:type: integer
:intent: input
:dims:
- ldgcol
- 2 * nlvl
- ldgcol:
:type: integer
:intent: input
- perm:
:type: integer
:intent: input
:dims:
- ldgcol
- nlvl
- givnum:
:type: real
:intent: input
:dims:
- ldu
- 2 * nlvl
- c:
:type: real
:intent: input
:dims:
- n
- s:
:type: real
:intent: input
:dims:
- n
- work:
:type: real
:intent: workspace
:dims:
- n
- iwork:
:type: integer
:intent: workspace
:dims:
- 3 * n
- info:
:type: integer
:intent: output
:substitutions:
ldbx: n
nlvl: (int)(1.0/log(2.0)*log((double)n/(smlsiz+1))) + 1
:fortran_help: " SUBROUTINE SLALSA( ICOMPQ, SMLSIZ, N, NRHS, B, LDB, BX, LDBX, U, LDU, VT, K, DIFL, DIFR, Z, POLES, GIVPTR, GIVCOL, LDGCOL, PERM, GIVNUM, C, S, WORK, IWORK, INFO )\n\n\
* Purpose\n\
* =======\n\
*\n\
* SLALSA is an itermediate step in solving the least squares problem\n\
* by computing the SVD of the coefficient matrix in compact form (The\n\
* singular vectors are computed as products of simple orthorgonal\n\
* matrices.).\n\
*\n\
* If ICOMPQ = 0, SLALSA applies the inverse of the left singular vector\n\
* matrix of an upper bidiagonal matrix to the right hand side; and if\n\
* ICOMPQ = 1, SLALSA applies the right singular vector matrix to the\n\
* right hand side. The singular vector matrices were generated in\n\
* compact form by SLALSA.\n\
*\n\n\
* Arguments\n\
* =========\n\
*\n\
*\n\
* ICOMPQ (input) INTEGER\n\
* Specifies whether the left or the right singular vector\n\
* matrix is involved.\n\
* = 0: Left singular vector matrix\n\
* = 1: Right singular vector matrix\n\
*\n\
* SMLSIZ (input) INTEGER\n\
* The maximum size of the subproblems at the bottom of the\n\
* computation tree.\n\
*\n\
* N (input) INTEGER\n\
* The row and column dimensions of the upper bidiagonal matrix.\n\
*\n\
* NRHS (input) INTEGER\n\
* The number of columns of B and BX. NRHS must be at least 1.\n\
*\n\
* B (input/output) REAL array, dimension ( LDB, NRHS )\n\
* On input, B contains the right hand sides of the least\n\
* squares problem in rows 1 through M.\n\
* On output, B contains the solution X in rows 1 through N.\n\
*\n\
* LDB (input) INTEGER\n\
* The leading dimension of B in the calling subprogram.\n\
* LDB must be at least max(1,MAX( M, N ) ).\n\
*\n\
* BX (output) REAL array, dimension ( LDBX, NRHS )\n\
* On exit, the result of applying the left or right singular\n\
* vector matrix to B.\n\
*\n\
* LDBX (input) INTEGER\n\
* The leading dimension of BX.\n\
*\n\
* U (input) REAL array, dimension ( LDU, SMLSIZ ).\n\
* On entry, U contains the left singular vector matrices of all\n\
* subproblems at the bottom level.\n\
*\n\
* LDU (input) INTEGER, LDU = > N.\n\
* The leading dimension of arrays U, VT, DIFL, DIFR,\n\
* POLES, GIVNUM, and Z.\n\
*\n\
* VT (input) REAL array, dimension ( LDU, SMLSIZ+1 ).\n\
* On entry, VT' contains the right singular vector matrices of\n\
* all subproblems at the bottom level.\n\
*\n\
* K (input) INTEGER array, dimension ( N ).\n\
*\n\
* DIFL (input) REAL array, dimension ( LDU, NLVL ).\n\
* where NLVL = INT(log_2 (N/(SMLSIZ+1))) + 1.\n\
*\n\
* DIFR (input) REAL array, dimension ( LDU, 2 * NLVL ).\n\
* On entry, DIFL(*, I) and DIFR(*, 2 * I -1) record\n\
* distances between singular values on the I-th level and\n\
* singular values on the (I -1)-th level, and DIFR(*, 2 * I)\n\
* record the normalizing factors of the right singular vectors\n\
* matrices of subproblems on I-th level.\n\
*\n\
* Z (input) REAL array, dimension ( LDU, NLVL ).\n\
* On entry, Z(1, I) contains the components of the deflation-\n\
* adjusted updating row vector for subproblems on the I-th\n\
* level.\n\
*\n\
* POLES (input) REAL array, dimension ( LDU, 2 * NLVL ).\n\
* On entry, POLES(*, 2 * I -1: 2 * I) contains the new and old\n\
* singular values involved in the secular equations on the I-th\n\
* level.\n\
*\n\
* GIVPTR (input) INTEGER array, dimension ( N ).\n\
* On entry, GIVPTR( I ) records the number of Givens\n\
* rotations performed on the I-th problem on the computation\n\
* tree.\n\
*\n\
* GIVCOL (input) INTEGER array, dimension ( LDGCOL, 2 * NLVL ).\n\
* On entry, for each I, GIVCOL(*, 2 * I - 1: 2 * I) records the\n\
* locations of Givens rotations performed on the I-th level on\n\
* the computation tree.\n\
*\n\
* LDGCOL (input) INTEGER, LDGCOL = > N.\n\
* The leading dimension of arrays GIVCOL and PERM.\n\
*\n\
* PERM (input) INTEGER array, dimension ( LDGCOL, NLVL ).\n\
* On entry, PERM(*, I) records permutations done on the I-th\n\
* level of the computation tree.\n\
*\n\
* GIVNUM (input) REAL array, dimension ( LDU, 2 * NLVL ).\n\
* On entry, GIVNUM(*, 2 *I -1 : 2 * I) records the C- and S-\n\
* values of Givens rotations performed on the I-th level on the\n\
* computation tree.\n\
*\n\
* C (input) REAL array, dimension ( N ).\n\
* On entry, if the I-th subproblem is not square,\n\
* C( I ) contains the C-value of a Givens rotation related to\n\
* the right null space of the I-th subproblem.\n\
*\n\
* S (input) REAL array, dimension ( N ).\n\
* On entry, if the I-th subproblem is not square,\n\
* S( I ) contains the S-value of a Givens rotation related to\n\
* the right null space of the I-th subproblem.\n\
*\n\
* WORK (workspace) REAL array.\n\
* The dimension must be at least N.\n\
*\n\
* IWORK (workspace) INTEGER array.\n\
* The dimension must be at least 3 * N\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 Ren-Cang Li, Computer Science Division, University of\n\
* California at Berkeley, USA\n\
* Osni Marques, LBNL/NERSC, USA\n\
*\n\
* =====================================================================\n\
*\n"
|