LAPACK 3.3.1
Linear Algebra PACKage
|
00001 SUBROUTINE DLA_PORFSX_EXTENDED( PREC_TYPE, UPLO, N, NRHS, A, LDA, 00002 $ AF, LDAF, COLEQU, C, B, LDB, Y, 00003 $ LDY, BERR_OUT, N_NORMS, 00004 $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES, 00005 $ AYB, DY, Y_TAIL, RCOND, ITHRESH, 00006 $ RTHRESH, DZ_UB, IGNORE_CWISE, 00007 $ INFO ) 00008 * 00009 * -- LAPACK routine (version 3.2.2) -- 00010 * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- 00011 * -- Jason Riedy of Univ. of California Berkeley. -- 00012 * -- June 2010 -- 00013 * 00014 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00015 * -- Univ. of California Berkeley and NAG Ltd. -- 00016 * 00017 IMPLICIT NONE 00018 * .. 00019 * .. Scalar Arguments .. 00020 INTEGER INFO, LDA, LDAF, LDB, LDY, N, NRHS, PREC_TYPE, 00021 $ N_NORMS, ITHRESH 00022 CHARACTER UPLO 00023 LOGICAL COLEQU, IGNORE_CWISE 00024 DOUBLE PRECISION RTHRESH, DZ_UB 00025 * .. 00026 * .. Array Arguments .. 00027 DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), B( LDB, * ), 00028 $ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * ) 00029 DOUBLE PRECISION C( * ), AYB(*), RCOND, BERR_OUT( * ), 00030 $ ERR_BNDS_NORM( NRHS, * ), 00031 $ ERR_BNDS_COMP( NRHS, * ) 00032 * .. 00033 * 00034 * Purpose 00035 * ======= 00036 * 00037 * DLA_PORFSX_EXTENDED improves the computed solution to a system of 00038 * linear equations by performing extra-precise iterative refinement 00039 * and provides error bounds and backward error estimates for the solution. 00040 * This subroutine is called by DPORFSX to perform iterative refinement. 00041 * In addition to normwise error bound, the code provides maximum 00042 * componentwise error bound if possible. See comments for ERR_BNDS_NORM 00043 * and ERR_BNDS_COMP for details of the error bounds. Note that this 00044 * subroutine is only resonsible for setting the second fields of 00045 * ERR_BNDS_NORM and ERR_BNDS_COMP. 00046 * 00047 * Arguments 00048 * ========= 00049 * 00050 * PREC_TYPE (input) INTEGER 00051 * Specifies the intermediate precision to be used in refinement. 00052 * The value is defined by ILAPREC(P) where P is a CHARACTER and 00053 * P = 'S': Single 00054 * = 'D': Double 00055 * = 'I': Indigenous 00056 * = 'X', 'E': Extra 00057 * 00058 * UPLO (input) CHARACTER*1 00059 * = 'U': Upper triangle of A is stored; 00060 * = 'L': Lower triangle of A is stored. 00061 * 00062 * N (input) INTEGER 00063 * The number of linear equations, i.e., the order of the 00064 * matrix A. N >= 0. 00065 * 00066 * NRHS (input) INTEGER 00067 * The number of right-hand-sides, i.e., the number of columns of the 00068 * matrix B. 00069 * 00070 * A (input) DOUBLE PRECISION array, dimension (LDA,N) 00071 * On entry, the N-by-N matrix A. 00072 * 00073 * LDA (input) INTEGER 00074 * The leading dimension of the array A. LDA >= max(1,N). 00075 * 00076 * AF (input) DOUBLE PRECISION array, dimension (LDAF,N) 00077 * The triangular factor U or L from the Cholesky factorization 00078 * A = U**T*U or A = L*L**T, as computed by DPOTRF. 00079 * 00080 * LDAF (input) INTEGER 00081 * The leading dimension of the array AF. LDAF >= max(1,N). 00082 * 00083 * COLEQU (input) LOGICAL 00084 * If .TRUE. then column equilibration was done to A before calling 00085 * this routine. This is needed to compute the solution and error 00086 * bounds correctly. 00087 * 00088 * C (input) DOUBLE PRECISION array, dimension (N) 00089 * The column scale factors for A. If COLEQU = .FALSE., C 00090 * is not accessed. If C is input, each element of C should be a power 00091 * of the radix to ensure a reliable solution and error estimates. 00092 * Scaling by powers of the radix does not cause rounding errors unless 00093 * the result underflows or overflows. Rounding errors during scaling 00094 * lead to refining with a matrix that is not equivalent to the 00095 * input matrix, producing error estimates that may not be 00096 * reliable. 00097 * 00098 * B (input) DOUBLE PRECISION array, dimension (LDB,NRHS) 00099 * The right-hand-side matrix B. 00100 * 00101 * LDB (input) INTEGER 00102 * The leading dimension of the array B. LDB >= max(1,N). 00103 * 00104 * Y (input/output) DOUBLE PRECISION array, dimension 00105 * (LDY,NRHS) 00106 * On entry, the solution matrix X, as computed by DPOTRS. 00107 * On exit, the improved solution matrix Y. 00108 * 00109 * LDY (input) INTEGER 00110 * The leading dimension of the array Y. LDY >= max(1,N). 00111 * 00112 * BERR_OUT (output) DOUBLE PRECISION array, dimension (NRHS) 00113 * On exit, BERR_OUT(j) contains the componentwise relative backward 00114 * error for right-hand-side j from the formula 00115 * max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) 00116 * where abs(Z) is the componentwise absolute value of the matrix 00117 * or vector Z. This is computed by DLA_LIN_BERR. 00118 * 00119 * N_NORMS (input) INTEGER 00120 * Determines which error bounds to return (see ERR_BNDS_NORM 00121 * and ERR_BNDS_COMP). 00122 * If N_NORMS >= 1 return normwise error bounds. 00123 * If N_NORMS >= 2 return componentwise error bounds. 00124 * 00125 * ERR_BNDS_NORM (input/output) DOUBLE PRECISION array, dimension 00126 * (NRHS, N_ERR_BNDS) 00127 * For each right-hand side, this array contains information about 00128 * various error bounds and condition numbers corresponding to the 00129 * normwise relative error, which is defined as follows: 00130 * 00131 * Normwise relative error in the ith solution vector: 00132 * max_j (abs(XTRUE(j,i) - X(j,i))) 00133 * ------------------------------ 00134 * max_j abs(X(j,i)) 00135 * 00136 * The array is indexed by the type of error information as described 00137 * below. There currently are up to three pieces of information 00138 * returned. 00139 * 00140 * The first index in ERR_BNDS_NORM(i,:) corresponds to the ith 00141 * right-hand side. 00142 * 00143 * The second index in ERR_BNDS_NORM(:,err) contains the following 00144 * three fields: 00145 * err = 1 "Trust/don't trust" boolean. Trust the answer if the 00146 * reciprocal condition number is less than the threshold 00147 * sqrt(n) * slamch('Epsilon'). 00148 * 00149 * err = 2 "Guaranteed" error bound: The estimated forward error, 00150 * almost certainly within a factor of 10 of the true error 00151 * so long as the next entry is greater than the threshold 00152 * sqrt(n) * slamch('Epsilon'). This error bound should only 00153 * be trusted if the previous boolean is true. 00154 * 00155 * err = 3 Reciprocal condition number: Estimated normwise 00156 * reciprocal condition number. Compared with the threshold 00157 * sqrt(n) * slamch('Epsilon') to determine if the error 00158 * estimate is "guaranteed". These reciprocal condition 00159 * numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some 00160 * appropriately scaled matrix Z. 00161 * Let Z = S*A, where S scales each row by a power of the 00162 * radix so all absolute row sums of Z are approximately 1. 00163 * 00164 * This subroutine is only responsible for setting the second field 00165 * above. 00166 * See Lapack Working Note 165 for further details and extra 00167 * cautions. 00168 * 00169 * ERR_BNDS_COMP (input/output) DOUBLE PRECISION array, dimension 00170 * (NRHS, N_ERR_BNDS) 00171 * For each right-hand side, this array contains information about 00172 * various error bounds and condition numbers corresponding to the 00173 * componentwise relative error, which is defined as follows: 00174 * 00175 * Componentwise relative error in the ith solution vector: 00176 * abs(XTRUE(j,i) - X(j,i)) 00177 * max_j ---------------------- 00178 * abs(X(j,i)) 00179 * 00180 * The array is indexed by the right-hand side i (on which the 00181 * componentwise relative error depends), and the type of error 00182 * information as described below. There currently are up to three 00183 * pieces of information returned for each right-hand side. If 00184 * componentwise accuracy is not requested (PARAMS(3) = 0.0), then 00185 * ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most 00186 * the first (:,N_ERR_BNDS) entries are returned. 00187 * 00188 * The first index in ERR_BNDS_COMP(i,:) corresponds to the ith 00189 * right-hand side. 00190 * 00191 * The second index in ERR_BNDS_COMP(:,err) contains the following 00192 * three fields: 00193 * err = 1 "Trust/don't trust" boolean. Trust the answer if the 00194 * reciprocal condition number is less than the threshold 00195 * sqrt(n) * slamch('Epsilon'). 00196 * 00197 * err = 2 "Guaranteed" error bound: The estimated forward error, 00198 * almost certainly within a factor of 10 of the true error 00199 * so long as the next entry is greater than the threshold 00200 * sqrt(n) * slamch('Epsilon'). This error bound should only 00201 * be trusted if the previous boolean is true. 00202 * 00203 * err = 3 Reciprocal condition number: Estimated componentwise 00204 * reciprocal condition number. Compared with the threshold 00205 * sqrt(n) * slamch('Epsilon') to determine if the error 00206 * estimate is "guaranteed". These reciprocal condition 00207 * numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some 00208 * appropriately scaled matrix Z. 00209 * Let Z = S*(A*diag(x)), where x is the solution for the 00210 * current right-hand side and S scales each row of 00211 * A*diag(x) by a power of the radix so all absolute row 00212 * sums of Z are approximately 1. 00213 * 00214 * This subroutine is only responsible for setting the second field 00215 * above. 00216 * See Lapack Working Note 165 for further details and extra 00217 * cautions. 00218 * 00219 * RES (input) DOUBLE PRECISION array, dimension (N) 00220 * Workspace to hold the intermediate residual. 00221 * 00222 * AYB (input) DOUBLE PRECISION array, dimension (N) 00223 * Workspace. This can be the same workspace passed for Y_TAIL. 00224 * 00225 * DY (input) DOUBLE PRECISION array, dimension (N) 00226 * Workspace to hold the intermediate solution. 00227 * 00228 * Y_TAIL (input) DOUBLE PRECISION array, dimension (N) 00229 * Workspace to hold the trailing bits of the intermediate solution. 00230 * 00231 * RCOND (input) DOUBLE PRECISION 00232 * Reciprocal scaled condition number. This is an estimate of the 00233 * reciprocal Skeel condition number of the matrix A after 00234 * equilibration (if done). If this is less than the machine 00235 * precision (in particular, if it is zero), the matrix is singular 00236 * to working precision. Note that the error may still be small even 00237 * if this number is very small and the matrix appears ill- 00238 * conditioned. 00239 * 00240 * ITHRESH (input) INTEGER 00241 * The maximum number of residual computations allowed for 00242 * refinement. The default is 10. For 'aggressive' set to 100 to 00243 * permit convergence using approximate factorizations or 00244 * factorizations other than LU. If the factorization uses a 00245 * technique other than Gaussian elimination, the guarantees in 00246 * ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. 00247 * 00248 * RTHRESH (input) DOUBLE PRECISION 00249 * Determines when to stop refinement if the error estimate stops 00250 * decreasing. Refinement will stop when the next solution no longer 00251 * satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is 00252 * the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The 00253 * default value is 0.5. For 'aggressive' set to 0.9 to permit 00254 * convergence on extremely ill-conditioned matrices. See LAWN 165 00255 * for more details. 00256 * 00257 * DZ_UB (input) DOUBLE PRECISION 00258 * Determines when to start considering componentwise convergence. 00259 * Componentwise convergence is only considered after each component 00260 * of the solution Y is stable, which we definte as the relative 00261 * change in each component being less than DZ_UB. The default value 00262 * is 0.25, requiring the first bit to be stable. See LAWN 165 for 00263 * more details. 00264 * 00265 * IGNORE_CWISE (input) LOGICAL 00266 * If .TRUE. then ignore componentwise convergence. Default value 00267 * is .FALSE.. 00268 * 00269 * INFO (output) INTEGER 00270 * = 0: Successful exit. 00271 * < 0: if INFO = -i, the ith argument to DPOTRS had an illegal 00272 * value 00273 * 00274 * ===================================================================== 00275 * 00276 * .. Local Scalars .. 00277 INTEGER UPLO2, CNT, I, J, X_STATE, Z_STATE 00278 DOUBLE PRECISION YK, DYK, YMIN, NORMY, NORMX, NORMDX, DXRAT, 00279 $ DZRAT, PREVNORMDX, PREV_DZ_Z, DXRATMAX, 00280 $ DZRATMAX, DX_X, DZ_Z, FINAL_DX_X, FINAL_DZ_Z, 00281 $ EPS, HUGEVAL, INCR_THRESH 00282 LOGICAL INCR_PREC 00283 * .. 00284 * .. Parameters .. 00285 INTEGER UNSTABLE_STATE, WORKING_STATE, CONV_STATE, 00286 $ NOPROG_STATE, Y_PREC_STATE, BASE_RESIDUAL, 00287 $ EXTRA_RESIDUAL, EXTRA_Y 00288 PARAMETER ( UNSTABLE_STATE = 0, WORKING_STATE = 1, 00289 $ CONV_STATE = 2, NOPROG_STATE = 3 ) 00290 PARAMETER ( BASE_RESIDUAL = 0, EXTRA_RESIDUAL = 1, 00291 $ EXTRA_Y = 2 ) 00292 INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I 00293 INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I 00294 INTEGER CMP_ERR_I, PIV_GROWTH_I 00295 PARAMETER ( FINAL_NRM_ERR_I = 1, FINAL_CMP_ERR_I = 2, 00296 $ BERR_I = 3 ) 00297 PARAMETER ( RCOND_I = 4, NRM_RCOND_I = 5, NRM_ERR_I = 6 ) 00298 PARAMETER ( CMP_RCOND_I = 7, CMP_ERR_I = 8, 00299 $ PIV_GROWTH_I = 9 ) 00300 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I, 00301 $ LA_LINRX_CWISE_I 00302 PARAMETER ( LA_LINRX_ITREF_I = 1, 00303 $ LA_LINRX_ITHRESH_I = 2 ) 00304 PARAMETER ( LA_LINRX_CWISE_I = 3 ) 00305 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I, 00306 $ LA_LINRX_RCOND_I 00307 PARAMETER ( LA_LINRX_TRUST_I = 1, LA_LINRX_ERR_I = 2 ) 00308 PARAMETER ( LA_LINRX_RCOND_I = 3 ) 00309 * .. 00310 * .. External Functions .. 00311 LOGICAL LSAME 00312 EXTERNAL ILAUPLO 00313 INTEGER ILAUPLO 00314 * .. 00315 * .. External Subroutines .. 00316 EXTERNAL DAXPY, DCOPY, DPOTRS, DSYMV, BLAS_DSYMV_X, 00317 $ BLAS_DSYMV2_X, DLA_SYAMV, DLA_WWADDW, 00318 $ DLA_LIN_BERR 00319 DOUBLE PRECISION DLAMCH 00320 * .. 00321 * .. Intrinsic Functions .. 00322 INTRINSIC ABS, MAX, MIN 00323 * .. 00324 * .. Executable Statements .. 00325 * 00326 IF (INFO.NE.0) RETURN 00327 EPS = DLAMCH( 'Epsilon' ) 00328 HUGEVAL = DLAMCH( 'Overflow' ) 00329 * Force HUGEVAL to Inf 00330 HUGEVAL = HUGEVAL * HUGEVAL 00331 * Using HUGEVAL may lead to spurious underflows. 00332 INCR_THRESH = DBLE( N ) * EPS 00333 00334 IF ( LSAME ( UPLO, 'L' ) ) THEN 00335 UPLO2 = ILAUPLO( 'L' ) 00336 ELSE 00337 UPLO2 = ILAUPLO( 'U' ) 00338 ENDIF 00339 00340 DO J = 1, NRHS 00341 Y_PREC_STATE = EXTRA_RESIDUAL 00342 IF ( Y_PREC_STATE .EQ. EXTRA_Y ) THEN 00343 DO I = 1, N 00344 Y_TAIL( I ) = 0.0D+0 00345 END DO 00346 END IF 00347 00348 DXRAT = 0.0D+0 00349 DXRATMAX = 0.0D+0 00350 DZRAT = 0.0D+0 00351 DZRATMAX = 0.0D+0 00352 FINAL_DX_X = HUGEVAL 00353 FINAL_DZ_Z = HUGEVAL 00354 PREVNORMDX = HUGEVAL 00355 PREV_DZ_Z = HUGEVAL 00356 DZ_Z = HUGEVAL 00357 DX_X = HUGEVAL 00358 00359 X_STATE = WORKING_STATE 00360 Z_STATE = UNSTABLE_STATE 00361 INCR_PREC = .FALSE. 00362 00363 DO CNT = 1, ITHRESH 00364 * 00365 * Compute residual RES = B_s - op(A_s) * Y, 00366 * op(A) = A, A**T, or A**H depending on TRANS (and type). 00367 * 00368 CALL DCOPY( N, B( 1, J ), 1, RES, 1 ) 00369 IF ( Y_PREC_STATE .EQ. BASE_RESIDUAL ) THEN 00370 CALL DSYMV( UPLO, N, -1.0D+0, A, LDA, Y(1,J), 1, 00371 $ 1.0D+0, RES, 1 ) 00372 ELSE IF ( Y_PREC_STATE .EQ. EXTRA_RESIDUAL ) THEN 00373 CALL BLAS_DSYMV_X( UPLO2, N, -1.0D+0, A, LDA, 00374 $ Y( 1, J ), 1, 1.0D+0, RES, 1, PREC_TYPE ) 00375 ELSE 00376 CALL BLAS_DSYMV2_X(UPLO2, N, -1.0D+0, A, LDA, 00377 $ Y(1, J), Y_TAIL, 1, 1.0D+0, RES, 1, PREC_TYPE) 00378 END IF 00379 00380 ! XXX: RES is no longer needed. 00381 CALL DCOPY( N, RES, 1, DY, 1 ) 00382 CALL DPOTRS( UPLO, N, 1, AF, LDAF, DY, N, INFO ) 00383 * 00384 * Calculate relative changes DX_X, DZ_Z and ratios DXRAT, DZRAT. 00385 * 00386 NORMX = 0.0D+0 00387 NORMY = 0.0D+0 00388 NORMDX = 0.0D+0 00389 DZ_Z = 0.0D+0 00390 YMIN = HUGEVAL 00391 00392 DO I = 1, N 00393 YK = ABS( Y( I, J ) ) 00394 DYK = ABS( DY( I ) ) 00395 00396 IF ( YK .NE. 0.0D+0 ) THEN 00397 DZ_Z = MAX( DZ_Z, DYK / YK ) 00398 ELSE IF ( DYK .NE. 0.0D+0 ) THEN 00399 DZ_Z = HUGEVAL 00400 END IF 00401 00402 YMIN = MIN( YMIN, YK ) 00403 00404 NORMY = MAX( NORMY, YK ) 00405 00406 IF ( COLEQU ) THEN 00407 NORMX = MAX( NORMX, YK * C( I ) ) 00408 NORMDX = MAX( NORMDX, DYK * C( I ) ) 00409 ELSE 00410 NORMX = NORMY 00411 NORMDX = MAX( NORMDX, DYK ) 00412 END IF 00413 END DO 00414 00415 IF ( NORMX .NE. 0.0D+0 ) THEN 00416 DX_X = NORMDX / NORMX 00417 ELSE IF ( NORMDX .EQ. 0.0D+0 ) THEN 00418 DX_X = 0.0D+0 00419 ELSE 00420 DX_X = HUGEVAL 00421 END IF 00422 00423 DXRAT = NORMDX / PREVNORMDX 00424 DZRAT = DZ_Z / PREV_DZ_Z 00425 * 00426 * Check termination criteria. 00427 * 00428 IF ( YMIN*RCOND .LT. INCR_THRESH*NORMY 00429 $ .AND. Y_PREC_STATE .LT. EXTRA_Y ) 00430 $ INCR_PREC = .TRUE. 00431 00432 IF ( X_STATE .EQ. NOPROG_STATE .AND. DXRAT .LE. RTHRESH ) 00433 $ X_STATE = WORKING_STATE 00434 IF ( X_STATE .EQ. WORKING_STATE ) THEN 00435 IF ( DX_X .LE. EPS ) THEN 00436 X_STATE = CONV_STATE 00437 ELSE IF ( DXRAT .GT. RTHRESH ) THEN 00438 IF ( Y_PREC_STATE .NE. EXTRA_Y ) THEN 00439 INCR_PREC = .TRUE. 00440 ELSE 00441 X_STATE = NOPROG_STATE 00442 END IF 00443 ELSE 00444 IF ( DXRAT .GT. DXRATMAX ) DXRATMAX = DXRAT 00445 END IF 00446 IF ( X_STATE .GT. WORKING_STATE ) FINAL_DX_X = DX_X 00447 END IF 00448 00449 IF ( Z_STATE .EQ. UNSTABLE_STATE .AND. DZ_Z .LE. DZ_UB ) 00450 $ Z_STATE = WORKING_STATE 00451 IF ( Z_STATE .EQ. NOPROG_STATE .AND. DZRAT .LE. RTHRESH ) 00452 $ Z_STATE = WORKING_STATE 00453 IF ( Z_STATE .EQ. WORKING_STATE ) THEN 00454 IF ( DZ_Z .LE. EPS ) THEN 00455 Z_STATE = CONV_STATE 00456 ELSE IF ( DZ_Z .GT. DZ_UB ) THEN 00457 Z_STATE = UNSTABLE_STATE 00458 DZRATMAX = 0.0D+0 00459 FINAL_DZ_Z = HUGEVAL 00460 ELSE IF ( DZRAT .GT. RTHRESH ) THEN 00461 IF ( Y_PREC_STATE .NE. EXTRA_Y ) THEN 00462 INCR_PREC = .TRUE. 00463 ELSE 00464 Z_STATE = NOPROG_STATE 00465 END IF 00466 ELSE 00467 IF ( DZRAT .GT. DZRATMAX ) DZRATMAX = DZRAT 00468 END IF 00469 IF ( Z_STATE .GT. WORKING_STATE ) FINAL_DZ_Z = DZ_Z 00470 END IF 00471 00472 IF ( X_STATE.NE.WORKING_STATE.AND. 00473 $ ( IGNORE_CWISE.OR.Z_STATE.NE.WORKING_STATE ) ) 00474 $ GOTO 666 00475 00476 IF ( INCR_PREC ) THEN 00477 INCR_PREC = .FALSE. 00478 Y_PREC_STATE = Y_PREC_STATE + 1 00479 DO I = 1, N 00480 Y_TAIL( I ) = 0.0D+0 00481 END DO 00482 END IF 00483 00484 PREVNORMDX = NORMDX 00485 PREV_DZ_Z = DZ_Z 00486 * 00487 * Update soluton. 00488 * 00489 IF (Y_PREC_STATE .LT. EXTRA_Y) THEN 00490 CALL DAXPY( N, 1.0D+0, DY, 1, Y(1,J), 1 ) 00491 ELSE 00492 CALL DLA_WWADDW( N, Y( 1, J ), Y_TAIL, DY ) 00493 END IF 00494 00495 END DO 00496 * Target of "IF (Z_STOP .AND. X_STOP)". Sun's f77 won't EXIT. 00497 666 CONTINUE 00498 * 00499 * Set final_* when cnt hits ithresh. 00500 * 00501 IF ( X_STATE .EQ. WORKING_STATE ) FINAL_DX_X = DX_X 00502 IF ( Z_STATE .EQ. WORKING_STATE ) FINAL_DZ_Z = DZ_Z 00503 * 00504 * Compute error bounds. 00505 * 00506 IF ( N_NORMS .GE. 1 ) THEN 00507 ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = 00508 $ FINAL_DX_X / (1 - DXRATMAX) 00509 END IF 00510 IF ( N_NORMS .GE. 2 ) THEN 00511 ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = 00512 $ FINAL_DZ_Z / (1 - DZRATMAX) 00513 END IF 00514 * 00515 * Compute componentwise relative backward error from formula 00516 * max(i) ( abs(R(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) 00517 * where abs(Z) is the componentwise absolute value of the matrix 00518 * or vector Z. 00519 * 00520 * Compute residual RES = B_s - op(A_s) * Y, 00521 * op(A) = A, A**T, or A**H depending on TRANS (and type). 00522 * 00523 CALL DCOPY( N, B( 1, J ), 1, RES, 1 ) 00524 CALL DSYMV( UPLO, N, -1.0D+0, A, LDA, Y(1,J), 1, 1.0D+0, RES, 00525 $ 1 ) 00526 00527 DO I = 1, N 00528 AYB( I ) = ABS( B( I, J ) ) 00529 END DO 00530 * 00531 * Compute abs(op(A_s))*abs(Y) + abs(B_s). 00532 * 00533 CALL DLA_SYAMV( UPLO2, N, 1.0D+0, 00534 $ A, LDA, Y(1, J), 1, 1.0D+0, AYB, 1 ) 00535 00536 CALL DLA_LIN_BERR( N, N, 1, RES, AYB, BERR_OUT( J ) ) 00537 * 00538 * End of loop for each RHS. 00539 * 00540 END DO 00541 * 00542 RETURN 00543 END