root / src / lapack / double / dlasda.f @ 2
Historique | Voir | Annoter | Télécharger (14,39 ko)
| 1 | 1 | pfleura2 | SUBROUTINE DLASDA( ICOMPQ, SMLSIZ, N, SQRE, D, E, U, LDU, VT, K, |
|---|---|---|---|
| 2 | 1 | pfleura2 | $ DIFL, DIFR, Z, POLES, GIVPTR, GIVCOL, LDGCOL, |
| 3 | 1 | pfleura2 | $ PERM, GIVNUM, C, S, WORK, IWORK, INFO ) |
| 4 | 1 | pfleura2 | * |
| 5 | 1 | pfleura2 | * -- LAPACK auxiliary routine (version 3.2.2) -- |
| 6 | 1 | pfleura2 | * -- LAPACK is a software package provided by Univ. of Tennessee, -- |
| 7 | 1 | pfleura2 | * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- |
| 8 | 1 | pfleura2 | * June 2010 |
| 9 | 1 | pfleura2 | * |
| 10 | 1 | pfleura2 | * .. Scalar Arguments .. |
| 11 | 1 | pfleura2 | INTEGER ICOMPQ, INFO, LDGCOL, LDU, N, SMLSIZ, SQRE |
| 12 | 1 | pfleura2 | * .. |
| 13 | 1 | pfleura2 | * .. Array Arguments .. |
| 14 | 1 | pfleura2 | INTEGER GIVCOL( LDGCOL, * ), GIVPTR( * ), IWORK( * ), |
| 15 | 1 | pfleura2 | $ K( * ), PERM( LDGCOL, * ) |
| 16 | 1 | pfleura2 | DOUBLE PRECISION C( * ), D( * ), DIFL( LDU, * ), DIFR( LDU, * ), |
| 17 | 1 | pfleura2 | $ E( * ), GIVNUM( LDU, * ), POLES( LDU, * ), |
| 18 | 1 | pfleura2 | $ S( * ), U( LDU, * ), VT( LDU, * ), WORK( * ), |
| 19 | 1 | pfleura2 | $ Z( LDU, * ) |
| 20 | 1 | pfleura2 | * .. |
| 21 | 1 | pfleura2 | * |
| 22 | 1 | pfleura2 | * Purpose |
| 23 | 1 | pfleura2 | * ======= |
| 24 | 1 | pfleura2 | * |
| 25 | 1 | pfleura2 | * Using a divide and conquer approach, DLASDA computes the singular |
| 26 | 1 | pfleura2 | * value decomposition (SVD) of a real upper bidiagonal N-by-M matrix |
| 27 | 1 | pfleura2 | * B with diagonal D and offdiagonal E, where M = N + SQRE. The |
| 28 | 1 | pfleura2 | * algorithm computes the singular values in the SVD B = U * S * VT. |
| 29 | 1 | pfleura2 | * The orthogonal matrices U and VT are optionally computed in |
| 30 | 1 | pfleura2 | * compact form. |
| 31 | 1 | pfleura2 | * |
| 32 | 1 | pfleura2 | * A related subroutine, DLASD0, computes the singular values and |
| 33 | 1 | pfleura2 | * the singular vectors in explicit form. |
| 34 | 1 | pfleura2 | * |
| 35 | 1 | pfleura2 | * Arguments |
| 36 | 1 | pfleura2 | * ========= |
| 37 | 1 | pfleura2 | * |
| 38 | 1 | pfleura2 | * ICOMPQ (input) INTEGER |
| 39 | 1 | pfleura2 | * Specifies whether singular vectors are to be computed |
| 40 | 1 | pfleura2 | * in compact form, as follows |
| 41 | 1 | pfleura2 | * = 0: Compute singular values only. |
| 42 | 1 | pfleura2 | * = 1: Compute singular vectors of upper bidiagonal |
| 43 | 1 | pfleura2 | * matrix in compact form. |
| 44 | 1 | pfleura2 | * |
| 45 | 1 | pfleura2 | * SMLSIZ (input) INTEGER |
| 46 | 1 | pfleura2 | * The maximum size of the subproblems at the bottom of the |
| 47 | 1 | pfleura2 | * computation tree. |
| 48 | 1 | pfleura2 | * |
| 49 | 1 | pfleura2 | * N (input) INTEGER |
| 50 | 1 | pfleura2 | * The row dimension of the upper bidiagonal matrix. This is |
| 51 | 1 | pfleura2 | * also the dimension of the main diagonal array D. |
| 52 | 1 | pfleura2 | * |
| 53 | 1 | pfleura2 | * SQRE (input) INTEGER |
| 54 | 1 | pfleura2 | * Specifies the column dimension of the bidiagonal matrix. |
| 55 | 1 | pfleura2 | * = 0: The bidiagonal matrix has column dimension M = N; |
| 56 | 1 | pfleura2 | * = 1: The bidiagonal matrix has column dimension M = N + 1. |
| 57 | 1 | pfleura2 | * |
| 58 | 1 | pfleura2 | * D (input/output) DOUBLE PRECISION array, dimension ( N ) |
| 59 | 1 | pfleura2 | * On entry D contains the main diagonal of the bidiagonal |
| 60 | 1 | pfleura2 | * matrix. On exit D, if INFO = 0, contains its singular values. |
| 61 | 1 | pfleura2 | * |
| 62 | 1 | pfleura2 | * E (input) DOUBLE PRECISION array, dimension ( M-1 ) |
| 63 | 1 | pfleura2 | * Contains the subdiagonal entries of the bidiagonal matrix. |
| 64 | 1 | pfleura2 | * On exit, E has been destroyed. |
| 65 | 1 | pfleura2 | * |
| 66 | 1 | pfleura2 | * U (output) DOUBLE PRECISION array, |
| 67 | 1 | pfleura2 | * dimension ( LDU, SMLSIZ ) if ICOMPQ = 1, and not referenced |
| 68 | 1 | pfleura2 | * if ICOMPQ = 0. If ICOMPQ = 1, on exit, U contains the left |
| 69 | 1 | pfleura2 | * singular vector matrices of all subproblems at the bottom |
| 70 | 1 | pfleura2 | * level. |
| 71 | 1 | pfleura2 | * |
| 72 | 1 | pfleura2 | * LDU (input) INTEGER, LDU = > N. |
| 73 | 1 | pfleura2 | * The leading dimension of arrays U, VT, DIFL, DIFR, POLES, |
| 74 | 1 | pfleura2 | * GIVNUM, and Z. |
| 75 | 1 | pfleura2 | * |
| 76 | 1 | pfleura2 | * VT (output) DOUBLE PRECISION array, |
| 77 | 1 | pfleura2 | * dimension ( LDU, SMLSIZ+1 ) if ICOMPQ = 1, and not referenced |
| 78 | 1 | pfleura2 | * if ICOMPQ = 0. If ICOMPQ = 1, on exit, VT' contains the right |
| 79 | 1 | pfleura2 | * singular vector matrices of all subproblems at the bottom |
| 80 | 1 | pfleura2 | * level. |
| 81 | 1 | pfleura2 | * |
| 82 | 1 | pfleura2 | * K (output) INTEGER array, |
| 83 | 1 | pfleura2 | * dimension ( N ) if ICOMPQ = 1 and dimension 1 if ICOMPQ = 0. |
| 84 | 1 | pfleura2 | * If ICOMPQ = 1, on exit, K(I) is the dimension of the I-th |
| 85 | 1 | pfleura2 | * secular equation on the computation tree. |
| 86 | 1 | pfleura2 | * |
| 87 | 1 | pfleura2 | * DIFL (output) DOUBLE PRECISION array, dimension ( LDU, NLVL ), |
| 88 | 1 | pfleura2 | * where NLVL = floor(log_2 (N/SMLSIZ))). |
| 89 | 1 | pfleura2 | * |
| 90 | 1 | pfleura2 | * DIFR (output) DOUBLE PRECISION array, |
| 91 | 1 | pfleura2 | * dimension ( LDU, 2 * NLVL ) if ICOMPQ = 1 and |
| 92 | 1 | pfleura2 | * dimension ( N ) if ICOMPQ = 0. |
| 93 | 1 | pfleura2 | * If ICOMPQ = 1, on exit, DIFL(1:N, I) and DIFR(1:N, 2 * I - 1) |
| 94 | 1 | pfleura2 | * record distances between singular values on the I-th |
| 95 | 1 | pfleura2 | * level and singular values on the (I -1)-th level, and |
| 96 | 1 | pfleura2 | * DIFR(1:N, 2 * I ) contains the normalizing factors for |
| 97 | 1 | pfleura2 | * the right singular vector matrix. See DLASD8 for details. |
| 98 | 1 | pfleura2 | * |
| 99 | 1 | pfleura2 | * Z (output) DOUBLE PRECISION array, |
| 100 | 1 | pfleura2 | * dimension ( LDU, NLVL ) if ICOMPQ = 1 and |
| 101 | 1 | pfleura2 | * dimension ( N ) if ICOMPQ = 0. |
| 102 | 1 | pfleura2 | * The first K elements of Z(1, I) contain the components of |
| 103 | 1 | pfleura2 | * the deflation-adjusted updating row vector for subproblems |
| 104 | 1 | pfleura2 | * on the I-th level. |
| 105 | 1 | pfleura2 | * |
| 106 | 1 | pfleura2 | * POLES (output) DOUBLE PRECISION array, |
| 107 | 1 | pfleura2 | * dimension ( LDU, 2 * NLVL ) if ICOMPQ = 1, and not referenced |
| 108 | 1 | pfleura2 | * if ICOMPQ = 0. If ICOMPQ = 1, on exit, POLES(1, 2*I - 1) and |
| 109 | 1 | pfleura2 | * POLES(1, 2*I) contain the new and old singular values |
| 110 | 1 | pfleura2 | * involved in the secular equations on the I-th level. |
| 111 | 1 | pfleura2 | * |
| 112 | 1 | pfleura2 | * GIVPTR (output) INTEGER array, |
| 113 | 1 | pfleura2 | * dimension ( N ) if ICOMPQ = 1, and not referenced if |
| 114 | 1 | pfleura2 | * ICOMPQ = 0. If ICOMPQ = 1, on exit, GIVPTR( I ) records |
| 115 | 1 | pfleura2 | * the number of Givens rotations performed on the I-th |
| 116 | 1 | pfleura2 | * problem on the computation tree. |
| 117 | 1 | pfleura2 | * |
| 118 | 1 | pfleura2 | * GIVCOL (output) INTEGER array, |
| 119 | 1 | pfleura2 | * dimension ( LDGCOL, 2 * NLVL ) if ICOMPQ = 1, and not |
| 120 | 1 | pfleura2 | * referenced if ICOMPQ = 0. If ICOMPQ = 1, on exit, for each I, |
| 121 | 1 | pfleura2 | * GIVCOL(1, 2 *I - 1) and GIVCOL(1, 2 *I) record the locations |
| 122 | 1 | pfleura2 | * of Givens rotations performed on the I-th level on the |
| 123 | 1 | pfleura2 | * computation tree. |
| 124 | 1 | pfleura2 | * |
| 125 | 1 | pfleura2 | * LDGCOL (input) INTEGER, LDGCOL = > N. |
| 126 | 1 | pfleura2 | * The leading dimension of arrays GIVCOL and PERM. |
| 127 | 1 | pfleura2 | * |
| 128 | 1 | pfleura2 | * PERM (output) INTEGER array, |
| 129 | 1 | pfleura2 | * dimension ( LDGCOL, NLVL ) if ICOMPQ = 1, and not referenced |
| 130 | 1 | pfleura2 | * if ICOMPQ = 0. If ICOMPQ = 1, on exit, PERM(1, I) records |
| 131 | 1 | pfleura2 | * permutations done on the I-th level of the computation tree. |
| 132 | 1 | pfleura2 | * |
| 133 | 1 | pfleura2 | * GIVNUM (output) DOUBLE PRECISION array, |
| 134 | 1 | pfleura2 | * dimension ( LDU, 2 * NLVL ) if ICOMPQ = 1, and not |
| 135 | 1 | pfleura2 | * referenced if ICOMPQ = 0. If ICOMPQ = 1, on exit, for each I, |
| 136 | 1 | pfleura2 | * GIVNUM(1, 2 *I - 1) and GIVNUM(1, 2 *I) record the C- and S- |
| 137 | 1 | pfleura2 | * values of Givens rotations performed on the I-th level on |
| 138 | 1 | pfleura2 | * the computation tree. |
| 139 | 1 | pfleura2 | * |
| 140 | 1 | pfleura2 | * C (output) DOUBLE PRECISION array, |
| 141 | 1 | pfleura2 | * dimension ( N ) if ICOMPQ = 1, and dimension 1 if ICOMPQ = 0. |
| 142 | 1 | pfleura2 | * If ICOMPQ = 1 and the I-th subproblem is not square, on exit, |
| 143 | 1 | pfleura2 | * C( I ) contains the C-value of a Givens rotation related to |
| 144 | 1 | pfleura2 | * the right null space of the I-th subproblem. |
| 145 | 1 | pfleura2 | * |
| 146 | 1 | pfleura2 | * S (output) DOUBLE PRECISION array, dimension ( N ) if |
| 147 | 1 | pfleura2 | * ICOMPQ = 1, and dimension 1 if ICOMPQ = 0. If ICOMPQ = 1 |
| 148 | 1 | pfleura2 | * and the I-th subproblem is not square, on exit, S( I ) |
| 149 | 1 | pfleura2 | * contains the S-value of a Givens rotation related to |
| 150 | 1 | pfleura2 | * the right null space of the I-th subproblem. |
| 151 | 1 | pfleura2 | * |
| 152 | 1 | pfleura2 | * WORK (workspace) DOUBLE PRECISION array, dimension |
| 153 | 1 | pfleura2 | * (6 * N + (SMLSIZ + 1)*(SMLSIZ + 1)). |
| 154 | 1 | pfleura2 | * |
| 155 | 1 | pfleura2 | * IWORK (workspace) INTEGER array. |
| 156 | 1 | pfleura2 | * Dimension must be at least (7 * N). |
| 157 | 1 | pfleura2 | * |
| 158 | 1 | pfleura2 | * INFO (output) INTEGER |
| 159 | 1 | pfleura2 | * = 0: successful exit. |
| 160 | 1 | pfleura2 | * < 0: if INFO = -i, the i-th argument had an illegal value. |
| 161 | 1 | pfleura2 | * > 0: if INFO = 1, a singular value did not converge |
| 162 | 1 | pfleura2 | * |
| 163 | 1 | pfleura2 | * Further Details |
| 164 | 1 | pfleura2 | * =============== |
| 165 | 1 | pfleura2 | * |
| 166 | 1 | pfleura2 | * Based on contributions by |
| 167 | 1 | pfleura2 | * Ming Gu and Huan Ren, Computer Science Division, University of |
| 168 | 1 | pfleura2 | * California at Berkeley, USA |
| 169 | 1 | pfleura2 | * |
| 170 | 1 | pfleura2 | * ===================================================================== |
| 171 | 1 | pfleura2 | * |
| 172 | 1 | pfleura2 | * .. Parameters .. |
| 173 | 1 | pfleura2 | DOUBLE PRECISION ZERO, ONE |
| 174 | 1 | pfleura2 | PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 ) |
| 175 | 1 | pfleura2 | * .. |
| 176 | 1 | pfleura2 | * .. Local Scalars .. |
| 177 | 1 | pfleura2 | INTEGER I, I1, IC, IDXQ, IDXQI, IM1, INODE, ITEMP, IWK, |
| 178 | 1 | pfleura2 | $ J, LF, LL, LVL, LVL2, M, NCC, ND, NDB1, NDIML, |
| 179 | 1 | pfleura2 | $ NDIMR, NL, NLF, NLP1, NLVL, NR, NRF, NRP1, NRU, |
| 180 | 1 | pfleura2 | $ NWORK1, NWORK2, SMLSZP, SQREI, VF, VFI, VL, VLI |
| 181 | 1 | pfleura2 | DOUBLE PRECISION ALPHA, BETA |
| 182 | 1 | pfleura2 | * .. |
| 183 | 1 | pfleura2 | * .. External Subroutines .. |
| 184 | 1 | pfleura2 | EXTERNAL DCOPY, DLASD6, DLASDQ, DLASDT, DLASET, XERBLA |
| 185 | 1 | pfleura2 | * .. |
| 186 | 1 | pfleura2 | * .. Executable Statements .. |
| 187 | 1 | pfleura2 | * |
| 188 | 1 | pfleura2 | * Test the input parameters. |
| 189 | 1 | pfleura2 | * |
| 190 | 1 | pfleura2 | INFO = 0 |
| 191 | 1 | pfleura2 | * |
| 192 | 1 | pfleura2 | IF( ( ICOMPQ.LT.0 ) .OR. ( ICOMPQ.GT.1 ) ) THEN |
| 193 | 1 | pfleura2 | INFO = -1 |
| 194 | 1 | pfleura2 | ELSE IF( SMLSIZ.LT.3 ) THEN |
| 195 | 1 | pfleura2 | INFO = -2 |
| 196 | 1 | pfleura2 | ELSE IF( N.LT.0 ) THEN |
| 197 | 1 | pfleura2 | INFO = -3 |
| 198 | 1 | pfleura2 | ELSE IF( ( SQRE.LT.0 ) .OR. ( SQRE.GT.1 ) ) THEN |
| 199 | 1 | pfleura2 | INFO = -4 |
| 200 | 1 | pfleura2 | ELSE IF( LDU.LT.( N+SQRE ) ) THEN |
| 201 | 1 | pfleura2 | INFO = -8 |
| 202 | 1 | pfleura2 | ELSE IF( LDGCOL.LT.N ) THEN |
| 203 | 1 | pfleura2 | INFO = -17 |
| 204 | 1 | pfleura2 | END IF |
| 205 | 1 | pfleura2 | IF( INFO.NE.0 ) THEN |
| 206 | 1 | pfleura2 | CALL XERBLA( 'DLASDA', -INFO ) |
| 207 | 1 | pfleura2 | RETURN |
| 208 | 1 | pfleura2 | END IF |
| 209 | 1 | pfleura2 | * |
| 210 | 1 | pfleura2 | M = N + SQRE |
| 211 | 1 | pfleura2 | * |
| 212 | 1 | pfleura2 | * If the input matrix is too small, call DLASDQ to find the SVD. |
| 213 | 1 | pfleura2 | * |
| 214 | 1 | pfleura2 | IF( N.LE.SMLSIZ ) THEN |
| 215 | 1 | pfleura2 | IF( ICOMPQ.EQ.0 ) THEN |
| 216 | 1 | pfleura2 | CALL DLASDQ( 'U', SQRE, N, 0, 0, 0, D, E, VT, LDU, U, LDU, |
| 217 | 1 | pfleura2 | $ U, LDU, WORK, INFO ) |
| 218 | 1 | pfleura2 | ELSE |
| 219 | 1 | pfleura2 | CALL DLASDQ( 'U', SQRE, N, M, N, 0, D, E, VT, LDU, U, LDU, |
| 220 | 1 | pfleura2 | $ U, LDU, WORK, INFO ) |
| 221 | 1 | pfleura2 | END IF |
| 222 | 1 | pfleura2 | RETURN |
| 223 | 1 | pfleura2 | END IF |
| 224 | 1 | pfleura2 | * |
| 225 | 1 | pfleura2 | * Book-keeping and set up the computation tree. |
| 226 | 1 | pfleura2 | * |
| 227 | 1 | pfleura2 | INODE = 1 |
| 228 | 1 | pfleura2 | NDIML = INODE + N |
| 229 | 1 | pfleura2 | NDIMR = NDIML + N |
| 230 | 1 | pfleura2 | IDXQ = NDIMR + N |
| 231 | 1 | pfleura2 | IWK = IDXQ + N |
| 232 | 1 | pfleura2 | * |
| 233 | 1 | pfleura2 | NCC = 0 |
| 234 | 1 | pfleura2 | NRU = 0 |
| 235 | 1 | pfleura2 | * |
| 236 | 1 | pfleura2 | SMLSZP = SMLSIZ + 1 |
| 237 | 1 | pfleura2 | VF = 1 |
| 238 | 1 | pfleura2 | VL = VF + M |
| 239 | 1 | pfleura2 | NWORK1 = VL + M |
| 240 | 1 | pfleura2 | NWORK2 = NWORK1 + SMLSZP*SMLSZP |
| 241 | 1 | pfleura2 | * |
| 242 | 1 | pfleura2 | CALL DLASDT( N, NLVL, ND, IWORK( INODE ), IWORK( NDIML ), |
| 243 | 1 | pfleura2 | $ IWORK( NDIMR ), SMLSIZ ) |
| 244 | 1 | pfleura2 | * |
| 245 | 1 | pfleura2 | * for the nodes on bottom level of the tree, solve |
| 246 | 1 | pfleura2 | * their subproblems by DLASDQ. |
| 247 | 1 | pfleura2 | * |
| 248 | 1 | pfleura2 | NDB1 = ( ND+1 ) / 2 |
| 249 | 1 | pfleura2 | DO 30 I = NDB1, ND |
| 250 | 1 | pfleura2 | * |
| 251 | 1 | pfleura2 | * IC : center row of each node |
| 252 | 1 | pfleura2 | * NL : number of rows of left subproblem |
| 253 | 1 | pfleura2 | * NR : number of rows of right subproblem |
| 254 | 1 | pfleura2 | * NLF: starting row of the left subproblem |
| 255 | 1 | pfleura2 | * NRF: starting row of the right subproblem |
| 256 | 1 | pfleura2 | * |
| 257 | 1 | pfleura2 | I1 = I - 1 |
| 258 | 1 | pfleura2 | IC = IWORK( INODE+I1 ) |
| 259 | 1 | pfleura2 | NL = IWORK( NDIML+I1 ) |
| 260 | 1 | pfleura2 | NLP1 = NL + 1 |
| 261 | 1 | pfleura2 | NR = IWORK( NDIMR+I1 ) |
| 262 | 1 | pfleura2 | NLF = IC - NL |
| 263 | 1 | pfleura2 | NRF = IC + 1 |
| 264 | 1 | pfleura2 | IDXQI = IDXQ + NLF - 2 |
| 265 | 1 | pfleura2 | VFI = VF + NLF - 1 |
| 266 | 1 | pfleura2 | VLI = VL + NLF - 1 |
| 267 | 1 | pfleura2 | SQREI = 1 |
| 268 | 1 | pfleura2 | IF( ICOMPQ.EQ.0 ) THEN |
| 269 | 1 | pfleura2 | CALL DLASET( 'A', NLP1, NLP1, ZERO, ONE, WORK( NWORK1 ), |
| 270 | 1 | pfleura2 | $ SMLSZP ) |
| 271 | 1 | pfleura2 | CALL DLASDQ( 'U', SQREI, NL, NLP1, NRU, NCC, D( NLF ), |
| 272 | 1 | pfleura2 | $ E( NLF ), WORK( NWORK1 ), SMLSZP, |
| 273 | 1 | pfleura2 | $ WORK( NWORK2 ), NL, WORK( NWORK2 ), NL, |
| 274 | 1 | pfleura2 | $ WORK( NWORK2 ), INFO ) |
| 275 | 1 | pfleura2 | ITEMP = NWORK1 + NL*SMLSZP |
| 276 | 1 | pfleura2 | CALL DCOPY( NLP1, WORK( NWORK1 ), 1, WORK( VFI ), 1 ) |
| 277 | 1 | pfleura2 | CALL DCOPY( NLP1, WORK( ITEMP ), 1, WORK( VLI ), 1 ) |
| 278 | 1 | pfleura2 | ELSE |
| 279 | 1 | pfleura2 | CALL DLASET( 'A', NL, NL, ZERO, ONE, U( NLF, 1 ), LDU ) |
| 280 | 1 | pfleura2 | CALL DLASET( 'A', NLP1, NLP1, ZERO, ONE, VT( NLF, 1 ), LDU ) |
| 281 | 1 | pfleura2 | CALL DLASDQ( 'U', SQREI, NL, NLP1, NL, NCC, D( NLF ), |
| 282 | 1 | pfleura2 | $ E( NLF ), VT( NLF, 1 ), LDU, U( NLF, 1 ), LDU, |
| 283 | 1 | pfleura2 | $ U( NLF, 1 ), LDU, WORK( NWORK1 ), INFO ) |
| 284 | 1 | pfleura2 | CALL DCOPY( NLP1, VT( NLF, 1 ), 1, WORK( VFI ), 1 ) |
| 285 | 1 | pfleura2 | CALL DCOPY( NLP1, VT( NLF, NLP1 ), 1, WORK( VLI ), 1 ) |
| 286 | 1 | pfleura2 | END IF |
| 287 | 1 | pfleura2 | IF( INFO.NE.0 ) THEN |
| 288 | 1 | pfleura2 | RETURN |
| 289 | 1 | pfleura2 | END IF |
| 290 | 1 | pfleura2 | DO 10 J = 1, NL |
| 291 | 1 | pfleura2 | IWORK( IDXQI+J ) = J |
| 292 | 1 | pfleura2 | 10 CONTINUE |
| 293 | 1 | pfleura2 | IF( ( I.EQ.ND ) .AND. ( SQRE.EQ.0 ) ) THEN |
| 294 | 1 | pfleura2 | SQREI = 0 |
| 295 | 1 | pfleura2 | ELSE |
| 296 | 1 | pfleura2 | SQREI = 1 |
| 297 | 1 | pfleura2 | END IF |
| 298 | 1 | pfleura2 | IDXQI = IDXQI + NLP1 |
| 299 | 1 | pfleura2 | VFI = VFI + NLP1 |
| 300 | 1 | pfleura2 | VLI = VLI + NLP1 |
| 301 | 1 | pfleura2 | NRP1 = NR + SQREI |
| 302 | 1 | pfleura2 | IF( ICOMPQ.EQ.0 ) THEN |
| 303 | 1 | pfleura2 | CALL DLASET( 'A', NRP1, NRP1, ZERO, ONE, WORK( NWORK1 ), |
| 304 | 1 | pfleura2 | $ SMLSZP ) |
| 305 | 1 | pfleura2 | CALL DLASDQ( 'U', SQREI, NR, NRP1, NRU, NCC, D( NRF ), |
| 306 | 1 | pfleura2 | $ E( NRF ), WORK( NWORK1 ), SMLSZP, |
| 307 | 1 | pfleura2 | $ WORK( NWORK2 ), NR, WORK( NWORK2 ), NR, |
| 308 | 1 | pfleura2 | $ WORK( NWORK2 ), INFO ) |
| 309 | 1 | pfleura2 | ITEMP = NWORK1 + ( NRP1-1 )*SMLSZP |
| 310 | 1 | pfleura2 | CALL DCOPY( NRP1, WORK( NWORK1 ), 1, WORK( VFI ), 1 ) |
| 311 | 1 | pfleura2 | CALL DCOPY( NRP1, WORK( ITEMP ), 1, WORK( VLI ), 1 ) |
| 312 | 1 | pfleura2 | ELSE |
| 313 | 1 | pfleura2 | CALL DLASET( 'A', NR, NR, ZERO, ONE, U( NRF, 1 ), LDU ) |
| 314 | 1 | pfleura2 | CALL DLASET( 'A', NRP1, NRP1, ZERO, ONE, VT( NRF, 1 ), LDU ) |
| 315 | 1 | pfleura2 | CALL DLASDQ( 'U', SQREI, NR, NRP1, NR, NCC, D( NRF ), |
| 316 | 1 | pfleura2 | $ E( NRF ), VT( NRF, 1 ), LDU, U( NRF, 1 ), LDU, |
| 317 | 1 | pfleura2 | $ U( NRF, 1 ), LDU, WORK( NWORK1 ), INFO ) |
| 318 | 1 | pfleura2 | CALL DCOPY( NRP1, VT( NRF, 1 ), 1, WORK( VFI ), 1 ) |
| 319 | 1 | pfleura2 | CALL DCOPY( NRP1, VT( NRF, NRP1 ), 1, WORK( VLI ), 1 ) |
| 320 | 1 | pfleura2 | END IF |
| 321 | 1 | pfleura2 | IF( INFO.NE.0 ) THEN |
| 322 | 1 | pfleura2 | RETURN |
| 323 | 1 | pfleura2 | END IF |
| 324 | 1 | pfleura2 | DO 20 J = 1, NR |
| 325 | 1 | pfleura2 | IWORK( IDXQI+J ) = J |
| 326 | 1 | pfleura2 | 20 CONTINUE |
| 327 | 1 | pfleura2 | 30 CONTINUE |
| 328 | 1 | pfleura2 | * |
| 329 | 1 | pfleura2 | * Now conquer each subproblem bottom-up. |
| 330 | 1 | pfleura2 | * |
| 331 | 1 | pfleura2 | J = 2**NLVL |
| 332 | 1 | pfleura2 | DO 50 LVL = NLVL, 1, -1 |
| 333 | 1 | pfleura2 | LVL2 = LVL*2 - 1 |
| 334 | 1 | pfleura2 | * |
| 335 | 1 | pfleura2 | * Find the first node LF and last node LL on |
| 336 | 1 | pfleura2 | * the current level LVL. |
| 337 | 1 | pfleura2 | * |
| 338 | 1 | pfleura2 | IF( LVL.EQ.1 ) THEN |
| 339 | 1 | pfleura2 | LF = 1 |
| 340 | 1 | pfleura2 | LL = 1 |
| 341 | 1 | pfleura2 | ELSE |
| 342 | 1 | pfleura2 | LF = 2**( LVL-1 ) |
| 343 | 1 | pfleura2 | LL = 2*LF - 1 |
| 344 | 1 | pfleura2 | END IF |
| 345 | 1 | pfleura2 | DO 40 I = LF, LL |
| 346 | 1 | pfleura2 | IM1 = I - 1 |
| 347 | 1 | pfleura2 | IC = IWORK( INODE+IM1 ) |
| 348 | 1 | pfleura2 | NL = IWORK( NDIML+IM1 ) |
| 349 | 1 | pfleura2 | NR = IWORK( NDIMR+IM1 ) |
| 350 | 1 | pfleura2 | NLF = IC - NL |
| 351 | 1 | pfleura2 | NRF = IC + 1 |
| 352 | 1 | pfleura2 | IF( I.EQ.LL ) THEN |
| 353 | 1 | pfleura2 | SQREI = SQRE |
| 354 | 1 | pfleura2 | ELSE |
| 355 | 1 | pfleura2 | SQREI = 1 |
| 356 | 1 | pfleura2 | END IF |
| 357 | 1 | pfleura2 | VFI = VF + NLF - 1 |
| 358 | 1 | pfleura2 | VLI = VL + NLF - 1 |
| 359 | 1 | pfleura2 | IDXQI = IDXQ + NLF - 1 |
| 360 | 1 | pfleura2 | ALPHA = D( IC ) |
| 361 | 1 | pfleura2 | BETA = E( IC ) |
| 362 | 1 | pfleura2 | IF( ICOMPQ.EQ.0 ) THEN |
| 363 | 1 | pfleura2 | CALL DLASD6( ICOMPQ, NL, NR, SQREI, D( NLF ), |
| 364 | 1 | pfleura2 | $ WORK( VFI ), WORK( VLI ), ALPHA, BETA, |
| 365 | 1 | pfleura2 | $ IWORK( IDXQI ), PERM, GIVPTR( 1 ), GIVCOL, |
| 366 | 1 | pfleura2 | $ LDGCOL, GIVNUM, LDU, POLES, DIFL, DIFR, Z, |
| 367 | 1 | pfleura2 | $ K( 1 ), C( 1 ), S( 1 ), WORK( NWORK1 ), |
| 368 | 1 | pfleura2 | $ IWORK( IWK ), INFO ) |
| 369 | 1 | pfleura2 | ELSE |
| 370 | 1 | pfleura2 | J = J - 1 |
| 371 | 1 | pfleura2 | CALL DLASD6( ICOMPQ, NL, NR, SQREI, D( NLF ), |
| 372 | 1 | pfleura2 | $ WORK( VFI ), WORK( VLI ), ALPHA, BETA, |
| 373 | 1 | pfleura2 | $ IWORK( IDXQI ), PERM( NLF, LVL ), |
| 374 | 1 | pfleura2 | $ GIVPTR( J ), GIVCOL( NLF, LVL2 ), LDGCOL, |
| 375 | 1 | pfleura2 | $ GIVNUM( NLF, LVL2 ), LDU, |
| 376 | 1 | pfleura2 | $ POLES( NLF, LVL2 ), DIFL( NLF, LVL ), |
| 377 | 1 | pfleura2 | $ DIFR( NLF, LVL2 ), Z( NLF, LVL ), K( J ), |
| 378 | 1 | pfleura2 | $ C( J ), S( J ), WORK( NWORK1 ), |
| 379 | 1 | pfleura2 | $ IWORK( IWK ), INFO ) |
| 380 | 1 | pfleura2 | END IF |
| 381 | 1 | pfleura2 | IF( INFO.NE.0 ) THEN |
| 382 | 1 | pfleura2 | RETURN |
| 383 | 1 | pfleura2 | END IF |
| 384 | 1 | pfleura2 | 40 CONTINUE |
| 385 | 1 | pfleura2 | 50 CONTINUE |
| 386 | 1 | pfleura2 | * |
| 387 | 1 | pfleura2 | RETURN |
| 388 | 1 | pfleura2 | * |
| 389 | 1 | pfleura2 | * End of DLASDA |
| 390 | 1 | pfleura2 | * |
| 391 | 1 | pfleura2 | END |