root / src / lapack / double / dlalsa.f @ 2
Historique | Voir | Annoter | Télécharger (12,16 ko)
| 1 | 1 | pfleura2 | SUBROUTINE DLALSA( ICOMPQ, SMLSIZ, N, NRHS, B, LDB, BX, LDBX, U, |
|---|---|---|---|
| 2 | 1 | pfleura2 | $ LDU, VT, K, DIFL, DIFR, Z, POLES, GIVPTR, |
| 3 | 1 | pfleura2 | $ GIVCOL, LDGCOL, PERM, GIVNUM, C, S, WORK, |
| 4 | 1 | pfleura2 | $ IWORK, INFO ) |
| 5 | 1 | pfleura2 | * |
| 6 | 1 | pfleura2 | * -- LAPACK routine (version 3.2) -- |
| 7 | 1 | pfleura2 | * -- LAPACK is a software package provided by Univ. of Tennessee, -- |
| 8 | 1 | pfleura2 | * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- |
| 9 | 1 | pfleura2 | * November 2006 |
| 10 | 1 | pfleura2 | * |
| 11 | 1 | pfleura2 | * .. Scalar Arguments .. |
| 12 | 1 | pfleura2 | INTEGER ICOMPQ, INFO, LDB, LDBX, LDGCOL, LDU, N, NRHS, |
| 13 | 1 | pfleura2 | $ SMLSIZ |
| 14 | 1 | pfleura2 | * .. |
| 15 | 1 | pfleura2 | * .. Array Arguments .. |
| 16 | 1 | pfleura2 | INTEGER GIVCOL( LDGCOL, * ), GIVPTR( * ), IWORK( * ), |
| 17 | 1 | pfleura2 | $ K( * ), PERM( LDGCOL, * ) |
| 18 | 1 | pfleura2 | DOUBLE PRECISION B( LDB, * ), BX( LDBX, * ), C( * ), |
| 19 | 1 | pfleura2 | $ DIFL( LDU, * ), DIFR( LDU, * ), |
| 20 | 1 | pfleura2 | $ GIVNUM( LDU, * ), POLES( LDU, * ), S( * ), |
| 21 | 1 | pfleura2 | $ U( LDU, * ), VT( LDU, * ), WORK( * ), |
| 22 | 1 | pfleura2 | $ Z( LDU, * ) |
| 23 | 1 | pfleura2 | * .. |
| 24 | 1 | pfleura2 | * |
| 25 | 1 | pfleura2 | * Purpose |
| 26 | 1 | pfleura2 | * ======= |
| 27 | 1 | pfleura2 | * |
| 28 | 1 | pfleura2 | * DLALSA is an itermediate step in solving the least squares problem |
| 29 | 1 | pfleura2 | * by computing the SVD of the coefficient matrix in compact form (The |
| 30 | 1 | pfleura2 | * singular vectors are computed as products of simple orthorgonal |
| 31 | 1 | pfleura2 | * matrices.). |
| 32 | 1 | pfleura2 | * |
| 33 | 1 | pfleura2 | * If ICOMPQ = 0, DLALSA applies the inverse of the left singular vector |
| 34 | 1 | pfleura2 | * matrix of an upper bidiagonal matrix to the right hand side; and if |
| 35 | 1 | pfleura2 | * ICOMPQ = 1, DLALSA applies the right singular vector matrix to the |
| 36 | 1 | pfleura2 | * right hand side. The singular vector matrices were generated in |
| 37 | 1 | pfleura2 | * compact form by DLALSA. |
| 38 | 1 | pfleura2 | * |
| 39 | 1 | pfleura2 | * Arguments |
| 40 | 1 | pfleura2 | * ========= |
| 41 | 1 | pfleura2 | * |
| 42 | 1 | pfleura2 | * |
| 43 | 1 | pfleura2 | * ICOMPQ (input) INTEGER |
| 44 | 1 | pfleura2 | * Specifies whether the left or the right singular vector |
| 45 | 1 | pfleura2 | * matrix is involved. |
| 46 | 1 | pfleura2 | * = 0: Left singular vector matrix |
| 47 | 1 | pfleura2 | * = 1: Right singular vector matrix |
| 48 | 1 | pfleura2 | * |
| 49 | 1 | pfleura2 | * SMLSIZ (input) INTEGER |
| 50 | 1 | pfleura2 | * The maximum size of the subproblems at the bottom of the |
| 51 | 1 | pfleura2 | * computation tree. |
| 52 | 1 | pfleura2 | * |
| 53 | 1 | pfleura2 | * N (input) INTEGER |
| 54 | 1 | pfleura2 | * The row and column dimensions of the upper bidiagonal matrix. |
| 55 | 1 | pfleura2 | * |
| 56 | 1 | pfleura2 | * NRHS (input) INTEGER |
| 57 | 1 | pfleura2 | * The number of columns of B and BX. NRHS must be at least 1. |
| 58 | 1 | pfleura2 | * |
| 59 | 1 | pfleura2 | * B (input/output) DOUBLE PRECISION array, dimension ( LDB, NRHS ) |
| 60 | 1 | pfleura2 | * On input, B contains the right hand sides of the least |
| 61 | 1 | pfleura2 | * squares problem in rows 1 through M. |
| 62 | 1 | pfleura2 | * On output, B contains the solution X in rows 1 through N. |
| 63 | 1 | pfleura2 | * |
| 64 | 1 | pfleura2 | * LDB (input) INTEGER |
| 65 | 1 | pfleura2 | * The leading dimension of B in the calling subprogram. |
| 66 | 1 | pfleura2 | * LDB must be at least max(1,MAX( M, N ) ). |
| 67 | 1 | pfleura2 | * |
| 68 | 1 | pfleura2 | * BX (output) DOUBLE PRECISION array, dimension ( LDBX, NRHS ) |
| 69 | 1 | pfleura2 | * On exit, the result of applying the left or right singular |
| 70 | 1 | pfleura2 | * vector matrix to B. |
| 71 | 1 | pfleura2 | * |
| 72 | 1 | pfleura2 | * LDBX (input) INTEGER |
| 73 | 1 | pfleura2 | * The leading dimension of BX. |
| 74 | 1 | pfleura2 | * |
| 75 | 1 | pfleura2 | * U (input) DOUBLE PRECISION array, dimension ( LDU, SMLSIZ ). |
| 76 | 1 | pfleura2 | * On entry, U contains the left singular vector matrices of all |
| 77 | 1 | pfleura2 | * subproblems at the bottom level. |
| 78 | 1 | pfleura2 | * |
| 79 | 1 | pfleura2 | * LDU (input) INTEGER, LDU = > N. |
| 80 | 1 | pfleura2 | * The leading dimension of arrays U, VT, DIFL, DIFR, |
| 81 | 1 | pfleura2 | * POLES, GIVNUM, and Z. |
| 82 | 1 | pfleura2 | * |
| 83 | 1 | pfleura2 | * VT (input) DOUBLE PRECISION array, dimension ( LDU, SMLSIZ+1 ). |
| 84 | 1 | pfleura2 | * On entry, VT' contains the right singular vector matrices of |
| 85 | 1 | pfleura2 | * all subproblems at the bottom level. |
| 86 | 1 | pfleura2 | * |
| 87 | 1 | pfleura2 | * K (input) INTEGER array, dimension ( N ). |
| 88 | 1 | pfleura2 | * |
| 89 | 1 | pfleura2 | * DIFL (input) DOUBLE PRECISION array, dimension ( LDU, NLVL ). |
| 90 | 1 | pfleura2 | * where NLVL = INT(log_2 (N/(SMLSIZ+1))) + 1. |
| 91 | 1 | pfleura2 | * |
| 92 | 1 | pfleura2 | * DIFR (input) DOUBLE PRECISION array, dimension ( LDU, 2 * NLVL ). |
| 93 | 1 | pfleura2 | * On entry, DIFL(*, I) and DIFR(*, 2 * I -1) record |
| 94 | 1 | pfleura2 | * distances between singular values on the I-th level and |
| 95 | 1 | pfleura2 | * singular values on the (I -1)-th level, and DIFR(*, 2 * I) |
| 96 | 1 | pfleura2 | * record the normalizing factors of the right singular vectors |
| 97 | 1 | pfleura2 | * matrices of subproblems on I-th level. |
| 98 | 1 | pfleura2 | * |
| 99 | 1 | pfleura2 | * Z (input) DOUBLE PRECISION array, dimension ( LDU, NLVL ). |
| 100 | 1 | pfleura2 | * On entry, Z(1, I) contains the components of the deflation- |
| 101 | 1 | pfleura2 | * adjusted updating row vector for subproblems on the I-th |
| 102 | 1 | pfleura2 | * level. |
| 103 | 1 | pfleura2 | * |
| 104 | 1 | pfleura2 | * POLES (input) DOUBLE PRECISION array, dimension ( LDU, 2 * NLVL ). |
| 105 | 1 | pfleura2 | * On entry, POLES(*, 2 * I -1: 2 * I) contains the new and old |
| 106 | 1 | pfleura2 | * singular values involved in the secular equations on the I-th |
| 107 | 1 | pfleura2 | * level. |
| 108 | 1 | pfleura2 | * |
| 109 | 1 | pfleura2 | * GIVPTR (input) INTEGER array, dimension ( N ). |
| 110 | 1 | pfleura2 | * On entry, GIVPTR( I ) records the number of Givens |
| 111 | 1 | pfleura2 | * rotations performed on the I-th problem on the computation |
| 112 | 1 | pfleura2 | * tree. |
| 113 | 1 | pfleura2 | * |
| 114 | 1 | pfleura2 | * GIVCOL (input) INTEGER array, dimension ( LDGCOL, 2 * NLVL ). |
| 115 | 1 | pfleura2 | * On entry, for each I, GIVCOL(*, 2 * I - 1: 2 * I) records the |
| 116 | 1 | pfleura2 | * locations of Givens rotations performed on the I-th level on |
| 117 | 1 | pfleura2 | * the computation tree. |
| 118 | 1 | pfleura2 | * |
| 119 | 1 | pfleura2 | * LDGCOL (input) INTEGER, LDGCOL = > N. |
| 120 | 1 | pfleura2 | * The leading dimension of arrays GIVCOL and PERM. |
| 121 | 1 | pfleura2 | * |
| 122 | 1 | pfleura2 | * PERM (input) INTEGER array, dimension ( LDGCOL, NLVL ). |
| 123 | 1 | pfleura2 | * On entry, PERM(*, I) records permutations done on the I-th |
| 124 | 1 | pfleura2 | * level of the computation tree. |
| 125 | 1 | pfleura2 | * |
| 126 | 1 | pfleura2 | * GIVNUM (input) DOUBLE PRECISION array, dimension ( LDU, 2 * NLVL ). |
| 127 | 1 | pfleura2 | * On entry, GIVNUM(*, 2 *I -1 : 2 * I) records the C- and S- |
| 128 | 1 | pfleura2 | * values of Givens rotations performed on the I-th level on the |
| 129 | 1 | pfleura2 | * computation tree. |
| 130 | 1 | pfleura2 | * |
| 131 | 1 | pfleura2 | * C (input) DOUBLE PRECISION array, dimension ( N ). |
| 132 | 1 | pfleura2 | * On entry, if the I-th subproblem is not square, |
| 133 | 1 | pfleura2 | * C( I ) contains the C-value of a Givens rotation related to |
| 134 | 1 | pfleura2 | * the right null space of the I-th subproblem. |
| 135 | 1 | pfleura2 | * |
| 136 | 1 | pfleura2 | * S (input) DOUBLE PRECISION array, dimension ( N ). |
| 137 | 1 | pfleura2 | * On entry, if the I-th subproblem is not square, |
| 138 | 1 | pfleura2 | * S( I ) contains the S-value of a Givens rotation related to |
| 139 | 1 | pfleura2 | * the right null space of the I-th subproblem. |
| 140 | 1 | pfleura2 | * |
| 141 | 1 | pfleura2 | * WORK (workspace) DOUBLE PRECISION array. |
| 142 | 1 | pfleura2 | * The dimension must be at least N. |
| 143 | 1 | pfleura2 | * |
| 144 | 1 | pfleura2 | * IWORK (workspace) INTEGER array. |
| 145 | 1 | pfleura2 | * The dimension must be at least 3 * N |
| 146 | 1 | pfleura2 | * |
| 147 | 1 | pfleura2 | * INFO (output) INTEGER |
| 148 | 1 | pfleura2 | * = 0: successful exit. |
| 149 | 1 | pfleura2 | * < 0: if INFO = -i, the i-th argument had an illegal value. |
| 150 | 1 | pfleura2 | * |
| 151 | 1 | pfleura2 | * Further Details |
| 152 | 1 | pfleura2 | * =============== |
| 153 | 1 | pfleura2 | * |
| 154 | 1 | pfleura2 | * Based on contributions by |
| 155 | 1 | pfleura2 | * Ming Gu and Ren-Cang Li, Computer Science Division, University of |
| 156 | 1 | pfleura2 | * California at Berkeley, USA |
| 157 | 1 | pfleura2 | * Osni Marques, LBNL/NERSC, USA |
| 158 | 1 | pfleura2 | * |
| 159 | 1 | pfleura2 | * ===================================================================== |
| 160 | 1 | pfleura2 | * |
| 161 | 1 | pfleura2 | * .. Parameters .. |
| 162 | 1 | pfleura2 | DOUBLE PRECISION ZERO, ONE |
| 163 | 1 | pfleura2 | PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0 ) |
| 164 | 1 | pfleura2 | * .. |
| 165 | 1 | pfleura2 | * .. Local Scalars .. |
| 166 | 1 | pfleura2 | INTEGER I, I1, IC, IM1, INODE, J, LF, LL, LVL, LVL2, |
| 167 | 1 | pfleura2 | $ ND, NDB1, NDIML, NDIMR, NL, NLF, NLP1, NLVL, |
| 168 | 1 | pfleura2 | $ NR, NRF, NRP1, SQRE |
| 169 | 1 | pfleura2 | * .. |
| 170 | 1 | pfleura2 | * .. External Subroutines .. |
| 171 | 1 | pfleura2 | EXTERNAL DCOPY, DGEMM, DLALS0, DLASDT, XERBLA |
| 172 | 1 | pfleura2 | * .. |
| 173 | 1 | pfleura2 | * .. Executable Statements .. |
| 174 | 1 | pfleura2 | * |
| 175 | 1 | pfleura2 | * Test the input parameters. |
| 176 | 1 | pfleura2 | * |
| 177 | 1 | pfleura2 | INFO = 0 |
| 178 | 1 | pfleura2 | * |
| 179 | 1 | pfleura2 | IF( ( ICOMPQ.LT.0 ) .OR. ( ICOMPQ.GT.1 ) ) THEN |
| 180 | 1 | pfleura2 | INFO = -1 |
| 181 | 1 | pfleura2 | ELSE IF( SMLSIZ.LT.3 ) THEN |
| 182 | 1 | pfleura2 | INFO = -2 |
| 183 | 1 | pfleura2 | ELSE IF( N.LT.SMLSIZ ) THEN |
| 184 | 1 | pfleura2 | INFO = -3 |
| 185 | 1 | pfleura2 | ELSE IF( NRHS.LT.1 ) THEN |
| 186 | 1 | pfleura2 | INFO = -4 |
| 187 | 1 | pfleura2 | ELSE IF( LDB.LT.N ) THEN |
| 188 | 1 | pfleura2 | INFO = -6 |
| 189 | 1 | pfleura2 | ELSE IF( LDBX.LT.N ) THEN |
| 190 | 1 | pfleura2 | INFO = -8 |
| 191 | 1 | pfleura2 | ELSE IF( LDU.LT.N ) THEN |
| 192 | 1 | pfleura2 | INFO = -10 |
| 193 | 1 | pfleura2 | ELSE IF( LDGCOL.LT.N ) THEN |
| 194 | 1 | pfleura2 | INFO = -19 |
| 195 | 1 | pfleura2 | END IF |
| 196 | 1 | pfleura2 | IF( INFO.NE.0 ) THEN |
| 197 | 1 | pfleura2 | CALL XERBLA( 'DLALSA', -INFO ) |
| 198 | 1 | pfleura2 | RETURN |
| 199 | 1 | pfleura2 | END IF |
| 200 | 1 | pfleura2 | * |
| 201 | 1 | pfleura2 | * Book-keeping and setting up the computation tree. |
| 202 | 1 | pfleura2 | * |
| 203 | 1 | pfleura2 | INODE = 1 |
| 204 | 1 | pfleura2 | NDIML = INODE + N |
| 205 | 1 | pfleura2 | NDIMR = NDIML + N |
| 206 | 1 | pfleura2 | * |
| 207 | 1 | pfleura2 | CALL DLASDT( N, NLVL, ND, IWORK( INODE ), IWORK( NDIML ), |
| 208 | 1 | pfleura2 | $ IWORK( NDIMR ), SMLSIZ ) |
| 209 | 1 | pfleura2 | * |
| 210 | 1 | pfleura2 | * The following code applies back the left singular vector factors. |
| 211 | 1 | pfleura2 | * For applying back the right singular vector factors, go to 50. |
| 212 | 1 | pfleura2 | * |
| 213 | 1 | pfleura2 | IF( ICOMPQ.EQ.1 ) THEN |
| 214 | 1 | pfleura2 | GO TO 50 |
| 215 | 1 | pfleura2 | END IF |
| 216 | 1 | pfleura2 | * |
| 217 | 1 | pfleura2 | * The nodes on the bottom level of the tree were solved |
| 218 | 1 | pfleura2 | * by DLASDQ. The corresponding left and right singular vector |
| 219 | 1 | pfleura2 | * matrices are in explicit form. First apply back the left |
| 220 | 1 | pfleura2 | * singular vector matrices. |
| 221 | 1 | pfleura2 | * |
| 222 | 1 | pfleura2 | NDB1 = ( ND+1 ) / 2 |
| 223 | 1 | pfleura2 | DO 10 I = NDB1, ND |
| 224 | 1 | pfleura2 | * |
| 225 | 1 | pfleura2 | * IC : center row of each node |
| 226 | 1 | pfleura2 | * NL : number of rows of left subproblem |
| 227 | 1 | pfleura2 | * NR : number of rows of right subproblem |
| 228 | 1 | pfleura2 | * NLF: starting row of the left subproblem |
| 229 | 1 | pfleura2 | * NRF: starting row of the right subproblem |
| 230 | 1 | pfleura2 | * |
| 231 | 1 | pfleura2 | I1 = I - 1 |
| 232 | 1 | pfleura2 | IC = IWORK( INODE+I1 ) |
| 233 | 1 | pfleura2 | NL = IWORK( NDIML+I1 ) |
| 234 | 1 | pfleura2 | NR = IWORK( NDIMR+I1 ) |
| 235 | 1 | pfleura2 | NLF = IC - NL |
| 236 | 1 | pfleura2 | NRF = IC + 1 |
| 237 | 1 | pfleura2 | CALL DGEMM( 'T', 'N', NL, NRHS, NL, ONE, U( NLF, 1 ), LDU, |
| 238 | 1 | pfleura2 | $ B( NLF, 1 ), LDB, ZERO, BX( NLF, 1 ), LDBX ) |
| 239 | 1 | pfleura2 | CALL DGEMM( 'T', 'N', NR, NRHS, NR, ONE, U( NRF, 1 ), LDU, |
| 240 | 1 | pfleura2 | $ B( NRF, 1 ), LDB, ZERO, BX( NRF, 1 ), LDBX ) |
| 241 | 1 | pfleura2 | 10 CONTINUE |
| 242 | 1 | pfleura2 | * |
| 243 | 1 | pfleura2 | * Next copy the rows of B that correspond to unchanged rows |
| 244 | 1 | pfleura2 | * in the bidiagonal matrix to BX. |
| 245 | 1 | pfleura2 | * |
| 246 | 1 | pfleura2 | DO 20 I = 1, ND |
| 247 | 1 | pfleura2 | IC = IWORK( INODE+I-1 ) |
| 248 | 1 | pfleura2 | CALL DCOPY( NRHS, B( IC, 1 ), LDB, BX( IC, 1 ), LDBX ) |
| 249 | 1 | pfleura2 | 20 CONTINUE |
| 250 | 1 | pfleura2 | * |
| 251 | 1 | pfleura2 | * Finally go through the left singular vector matrices of all |
| 252 | 1 | pfleura2 | * the other subproblems bottom-up on the tree. |
| 253 | 1 | pfleura2 | * |
| 254 | 1 | pfleura2 | J = 2**NLVL |
| 255 | 1 | pfleura2 | SQRE = 0 |
| 256 | 1 | pfleura2 | * |
| 257 | 1 | pfleura2 | DO 40 LVL = NLVL, 1, -1 |
| 258 | 1 | pfleura2 | LVL2 = 2*LVL - 1 |
| 259 | 1 | pfleura2 | * |
| 260 | 1 | pfleura2 | * find the first node LF and last node LL on |
| 261 | 1 | pfleura2 | * the current level LVL |
| 262 | 1 | pfleura2 | * |
| 263 | 1 | pfleura2 | IF( LVL.EQ.1 ) THEN |
| 264 | 1 | pfleura2 | LF = 1 |
| 265 | 1 | pfleura2 | LL = 1 |
| 266 | 1 | pfleura2 | ELSE |
| 267 | 1 | pfleura2 | LF = 2**( LVL-1 ) |
| 268 | 1 | pfleura2 | LL = 2*LF - 1 |
| 269 | 1 | pfleura2 | END IF |
| 270 | 1 | pfleura2 | DO 30 I = LF, LL |
| 271 | 1 | pfleura2 | IM1 = I - 1 |
| 272 | 1 | pfleura2 | IC = IWORK( INODE+IM1 ) |
| 273 | 1 | pfleura2 | NL = IWORK( NDIML+IM1 ) |
| 274 | 1 | pfleura2 | NR = IWORK( NDIMR+IM1 ) |
| 275 | 1 | pfleura2 | NLF = IC - NL |
| 276 | 1 | pfleura2 | NRF = IC + 1 |
| 277 | 1 | pfleura2 | J = J - 1 |
| 278 | 1 | pfleura2 | CALL DLALS0( ICOMPQ, NL, NR, SQRE, NRHS, BX( NLF, 1 ), LDBX, |
| 279 | 1 | pfleura2 | $ B( NLF, 1 ), LDB, PERM( NLF, LVL ), |
| 280 | 1 | pfleura2 | $ GIVPTR( J ), GIVCOL( NLF, LVL2 ), LDGCOL, |
| 281 | 1 | pfleura2 | $ GIVNUM( NLF, LVL2 ), LDU, POLES( NLF, LVL2 ), |
| 282 | 1 | pfleura2 | $ DIFL( NLF, LVL ), DIFR( NLF, LVL2 ), |
| 283 | 1 | pfleura2 | $ Z( NLF, LVL ), K( J ), C( J ), S( J ), WORK, |
| 284 | 1 | pfleura2 | $ INFO ) |
| 285 | 1 | pfleura2 | 30 CONTINUE |
| 286 | 1 | pfleura2 | 40 CONTINUE |
| 287 | 1 | pfleura2 | GO TO 90 |
| 288 | 1 | pfleura2 | * |
| 289 | 1 | pfleura2 | * ICOMPQ = 1: applying back the right singular vector factors. |
| 290 | 1 | pfleura2 | * |
| 291 | 1 | pfleura2 | 50 CONTINUE |
| 292 | 1 | pfleura2 | * |
| 293 | 1 | pfleura2 | * First now go through the right singular vector matrices of all |
| 294 | 1 | pfleura2 | * the tree nodes top-down. |
| 295 | 1 | pfleura2 | * |
| 296 | 1 | pfleura2 | J = 0 |
| 297 | 1 | pfleura2 | DO 70 LVL = 1, NLVL |
| 298 | 1 | pfleura2 | LVL2 = 2*LVL - 1 |
| 299 | 1 | pfleura2 | * |
| 300 | 1 | pfleura2 | * Find the first node LF and last node LL on |
| 301 | 1 | pfleura2 | * the current level LVL. |
| 302 | 1 | pfleura2 | * |
| 303 | 1 | pfleura2 | IF( LVL.EQ.1 ) THEN |
| 304 | 1 | pfleura2 | LF = 1 |
| 305 | 1 | pfleura2 | LL = 1 |
| 306 | 1 | pfleura2 | ELSE |
| 307 | 1 | pfleura2 | LF = 2**( LVL-1 ) |
| 308 | 1 | pfleura2 | LL = 2*LF - 1 |
| 309 | 1 | pfleura2 | END IF |
| 310 | 1 | pfleura2 | DO 60 I = LL, LF, -1 |
| 311 | 1 | pfleura2 | IM1 = I - 1 |
| 312 | 1 | pfleura2 | IC = IWORK( INODE+IM1 ) |
| 313 | 1 | pfleura2 | NL = IWORK( NDIML+IM1 ) |
| 314 | 1 | pfleura2 | NR = IWORK( NDIMR+IM1 ) |
| 315 | 1 | pfleura2 | NLF = IC - NL |
| 316 | 1 | pfleura2 | NRF = IC + 1 |
| 317 | 1 | pfleura2 | IF( I.EQ.LL ) THEN |
| 318 | 1 | pfleura2 | SQRE = 0 |
| 319 | 1 | pfleura2 | ELSE |
| 320 | 1 | pfleura2 | SQRE = 1 |
| 321 | 1 | pfleura2 | END IF |
| 322 | 1 | pfleura2 | J = J + 1 |
| 323 | 1 | pfleura2 | CALL DLALS0( ICOMPQ, NL, NR, SQRE, NRHS, B( NLF, 1 ), LDB, |
| 324 | 1 | pfleura2 | $ BX( NLF, 1 ), LDBX, PERM( NLF, LVL ), |
| 325 | 1 | pfleura2 | $ GIVPTR( J ), GIVCOL( NLF, LVL2 ), LDGCOL, |
| 326 | 1 | pfleura2 | $ GIVNUM( NLF, LVL2 ), LDU, POLES( NLF, LVL2 ), |
| 327 | 1 | pfleura2 | $ DIFL( NLF, LVL ), DIFR( NLF, LVL2 ), |
| 328 | 1 | pfleura2 | $ Z( NLF, LVL ), K( J ), C( J ), S( J ), WORK, |
| 329 | 1 | pfleura2 | $ INFO ) |
| 330 | 1 | pfleura2 | 60 CONTINUE |
| 331 | 1 | pfleura2 | 70 CONTINUE |
| 332 | 1 | pfleura2 | * |
| 333 | 1 | pfleura2 | * The nodes on the bottom level of the tree were solved |
| 334 | 1 | pfleura2 | * by DLASDQ. The corresponding right singular vector |
| 335 | 1 | pfleura2 | * matrices are in explicit form. Apply them back. |
| 336 | 1 | pfleura2 | * |
| 337 | 1 | pfleura2 | NDB1 = ( ND+1 ) / 2 |
| 338 | 1 | pfleura2 | DO 80 I = NDB1, ND |
| 339 | 1 | pfleura2 | I1 = I - 1 |
| 340 | 1 | pfleura2 | IC = IWORK( INODE+I1 ) |
| 341 | 1 | pfleura2 | NL = IWORK( NDIML+I1 ) |
| 342 | 1 | pfleura2 | NR = IWORK( NDIMR+I1 ) |
| 343 | 1 | pfleura2 | NLP1 = NL + 1 |
| 344 | 1 | pfleura2 | IF( I.EQ.ND ) THEN |
| 345 | 1 | pfleura2 | NRP1 = NR |
| 346 | 1 | pfleura2 | ELSE |
| 347 | 1 | pfleura2 | NRP1 = NR + 1 |
| 348 | 1 | pfleura2 | END IF |
| 349 | 1 | pfleura2 | NLF = IC - NL |
| 350 | 1 | pfleura2 | NRF = IC + 1 |
| 351 | 1 | pfleura2 | CALL DGEMM( 'T', 'N', NLP1, NRHS, NLP1, ONE, VT( NLF, 1 ), LDU, |
| 352 | 1 | pfleura2 | $ B( NLF, 1 ), LDB, ZERO, BX( NLF, 1 ), LDBX ) |
| 353 | 1 | pfleura2 | CALL DGEMM( 'T', 'N', NRP1, NRHS, NRP1, ONE, VT( NRF, 1 ), LDU, |
| 354 | 1 | pfleura2 | $ B( NRF, 1 ), LDB, ZERO, BX( NRF, 1 ), LDBX ) |
| 355 | 1 | pfleura2 | 80 CONTINUE |
| 356 | 1 | pfleura2 | * |
| 357 | 1 | pfleura2 | 90 CONTINUE |
| 358 | 1 | pfleura2 | * |
| 359 | 1 | pfleura2 | RETURN |
| 360 | 1 | pfleura2 | * |
| 361 | 1 | pfleura2 | * End of DLALSA |
| 362 | 1 | pfleura2 | * |
| 363 | 1 | pfleura2 | END |