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