00001 /* sla_syrfsx_extended.f -- translated by f2c (version 20061008). 00002 You must link the resulting object file with libf2c: 00003 on Microsoft Windows system, link with libf2c.lib; 00004 on Linux or Unix systems, link with .../path/to/libf2c.a -lm 00005 or, if you install libf2c.a in a standard place, with -lf2c -lm 00006 -- in that order, at the end of the command line, as in 00007 cc *.o -lf2c -lm 00008 Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 00009 00010 http://www.netlib.org/f2c/libf2c.zip 00011 */ 00012 00013 #include "f2c.h" 00014 #include "blaswrap.h" 00015 00016 /* Table of constant values */ 00017 00018 static integer c__1 = 1; 00019 static real c_b9 = -1.f; 00020 static real c_b11 = 1.f; 00021 00022 /* Subroutine */ int sla_syrfsx_extended__(integer *prec_type__, char *uplo, 00023 integer *n, integer *nrhs, real *a, integer *lda, real *af, integer * 00024 ldaf, integer *ipiv, logical *colequ, real *c__, real *b, integer * 00025 ldb, real *y, integer *ldy, real *berr_out__, integer *n_norms__, 00026 real *err_bnds_norm__, real *err_bnds_comp__, real *res, real *ayb, 00027 real *dy, real *y_tail__, real *rcond, integer *ithresh, real * 00028 rthresh, real *dz_ub__, logical *ignore_cwise__, integer *info, 00029 ftnlen uplo_len) 00030 { 00031 /* System generated locals */ 00032 integer a_dim1, a_offset, af_dim1, af_offset, b_dim1, b_offset, y_dim1, 00033 y_offset, err_bnds_norm_dim1, err_bnds_norm_offset, 00034 err_bnds_comp_dim1, err_bnds_comp_offset, i__1, i__2, i__3; 00035 real r__1, r__2; 00036 00037 /* Local variables */ 00038 real dxratmax, dzratmax; 00039 integer i__, j; 00040 logical incr_prec__; 00041 extern /* Subroutine */ int sla_syamv__(integer *, integer *, real *, 00042 real *, integer *, real *, integer *, real *, real *, integer *); 00043 real prev_dz_z__, yk, final_dx_x__, final_dz_z__; 00044 extern /* Subroutine */ int sla_wwaddw__(integer *, real *, real *, real * 00045 ); 00046 real prevnormdx; 00047 integer cnt; 00048 real dyk, eps, incr_thresh__, dx_x__, dz_z__, ymin; 00049 extern /* Subroutine */ int sla_lin_berr__(integer *, integer *, integer * 00050 , real *, real *, real *); 00051 integer y_prec_state__, uplo2; 00052 extern /* Subroutine */ int blas_ssymv_x__(integer *, integer *, real *, 00053 real *, integer *, real *, integer *, real *, real *, integer *, 00054 integer *); 00055 extern logical lsame_(char *, char *); 00056 real dxrat, dzrat; 00057 extern /* Subroutine */ int blas_ssymv2_x__(integer *, integer *, real *, 00058 real *, integer *, real *, real *, integer *, real *, real *, 00059 integer *, integer *), scopy_(integer *, real *, integer *, real * 00060 , integer *); 00061 real normx, normy; 00062 extern /* Subroutine */ int saxpy_(integer *, real *, real *, integer *, 00063 real *, integer *), ssymv_(char *, integer *, real *, real *, 00064 integer *, real *, integer *, real *, real *, integer *); 00065 extern doublereal slamch_(char *); 00066 real normdx; 00067 extern /* Subroutine */ int ssytrs_(char *, integer *, integer *, real *, 00068 integer *, integer *, real *, integer *, integer *); 00069 real hugeval; 00070 extern integer ilauplo_(char *); 00071 integer x_state__, z_state__; 00072 00073 00074 /* -- LAPACK routine (version 3.2.1) -- */ 00075 /* -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- */ 00076 /* -- Jason Riedy of Univ. of California Berkeley. -- */ 00077 /* -- April 2009 -- */ 00078 00079 /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */ 00080 /* -- Univ. of California Berkeley and NAG Ltd. -- */ 00081 00082 /* .. */ 00083 /* .. Scalar Arguments .. */ 00084 /* .. */ 00085 /* .. Array Arguments .. */ 00086 /* .. */ 00087 00088 /* Purpose */ 00089 /* ======= */ 00090 00091 /* SLA_SYRFSX_EXTENDED improves the computed solution to a system of */ 00092 /* linear equations by performing extra-precise iterative refinement */ 00093 /* and provides error bounds and backward error estimates for the solution. */ 00094 /* This subroutine is called by SSYRFSX to perform iterative refinement. */ 00095 /* In addition to normwise error bound, the code provides maximum */ 00096 /* componentwise error bound if possible. See comments for ERR_BNDS_NORM */ 00097 /* and ERR_BNDS_COMP for details of the error bounds. Note that this */ 00098 /* subroutine is only resonsible for setting the second fields of */ 00099 /* ERR_BNDS_NORM and ERR_BNDS_COMP. */ 00100 00101 /* Arguments */ 00102 /* ========= */ 00103 00104 /* PREC_TYPE (input) INTEGER */ 00105 /* Specifies the intermediate precision to be used in refinement. */ 00106 /* The value is defined by ILAPREC(P) where P is a CHARACTER and */ 00107 /* P = 'S': Single */ 00108 /* = 'D': Double */ 00109 /* = 'I': Indigenous */ 00110 /* = 'X', 'E': Extra */ 00111 00112 /* UPLO (input) CHARACTER*1 */ 00113 /* = 'U': Upper triangle of A is stored; */ 00114 /* = 'L': Lower triangle of A is stored. */ 00115 00116 /* N (input) INTEGER */ 00117 /* The number of linear equations, i.e., the order of the */ 00118 /* matrix A. N >= 0. */ 00119 00120 /* NRHS (input) INTEGER */ 00121 /* The number of right-hand-sides, i.e., the number of columns of the */ 00122 /* matrix B. */ 00123 00124 /* A (input) REAL array, dimension (LDA,N) */ 00125 /* On entry, the N-by-N matrix A. */ 00126 00127 /* LDA (input) INTEGER */ 00128 /* The leading dimension of the array A. LDA >= max(1,N). */ 00129 00130 /* AF (input) REAL array, dimension (LDAF,N) */ 00131 /* The block diagonal matrix D and the multipliers used to */ 00132 /* obtain the factor U or L as computed by SSYTRF. */ 00133 00134 /* LDAF (input) INTEGER */ 00135 /* The leading dimension of the array AF. LDAF >= max(1,N). */ 00136 00137 /* IPIV (input) INTEGER array, dimension (N) */ 00138 /* Details of the interchanges and the block structure of D */ 00139 /* as determined by SSYTRF. */ 00140 00141 /* COLEQU (input) LOGICAL */ 00142 /* If .TRUE. then column equilibration was done to A before calling */ 00143 /* this routine. This is needed to compute the solution and error */ 00144 /* bounds correctly. */ 00145 00146 /* C (input) REAL array, dimension (N) */ 00147 /* The column scale factors for A. If COLEQU = .FALSE., C */ 00148 /* is not accessed. If C is input, each element of C should be a power */ 00149 /* of the radix to ensure a reliable solution and error estimates. */ 00150 /* Scaling by powers of the radix does not cause rounding errors unless */ 00151 /* the result underflows or overflows. Rounding errors during scaling */ 00152 /* lead to refining with a matrix that is not equivalent to the */ 00153 /* input matrix, producing error estimates that may not be */ 00154 /* reliable. */ 00155 00156 /* B (input) REAL array, dimension (LDB,NRHS) */ 00157 /* The right-hand-side matrix B. */ 00158 00159 /* LDB (input) INTEGER */ 00160 /* The leading dimension of the array B. LDB >= max(1,N). */ 00161 00162 /* Y (input/output) REAL array, dimension (LDY,NRHS) */ 00163 /* On entry, the solution matrix X, as computed by SSYTRS. */ 00164 /* On exit, the improved solution matrix Y. */ 00165 00166 /* LDY (input) INTEGER */ 00167 /* The leading dimension of the array Y. LDY >= max(1,N). */ 00168 00169 /* BERR_OUT (output) REAL array, dimension (NRHS) */ 00170 /* On exit, BERR_OUT(j) contains the componentwise relative backward */ 00171 /* error for right-hand-side j from the formula */ 00172 /* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) */ 00173 /* where abs(Z) is the componentwise absolute value of the matrix */ 00174 /* or vector Z. This is computed by SLA_LIN_BERR. */ 00175 00176 /* N_NORMS (input) INTEGER */ 00177 /* Determines which error bounds to return (see ERR_BNDS_NORM */ 00178 /* and ERR_BNDS_COMP). */ 00179 /* If N_NORMS >= 1 return normwise error bounds. */ 00180 /* If N_NORMS >= 2 return componentwise error bounds. */ 00181 00182 /* ERR_BNDS_NORM (input/output) REAL array, dimension (NRHS, N_ERR_BNDS) */ 00183 /* For each right-hand side, this array contains information about */ 00184 /* various error bounds and condition numbers corresponding to the */ 00185 /* normwise relative error, which is defined as follows: */ 00186 00187 /* Normwise relative error in the ith solution vector: */ 00188 /* max_j (abs(XTRUE(j,i) - X(j,i))) */ 00189 /* ------------------------------ */ 00190 /* max_j abs(X(j,i)) */ 00191 00192 /* The array is indexed by the type of error information as described */ 00193 /* below. There currently are up to three pieces of information */ 00194 /* returned. */ 00195 00196 /* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith */ 00197 /* right-hand side. */ 00198 00199 /* The second index in ERR_BNDS_NORM(:,err) contains the following */ 00200 /* three fields: */ 00201 /* err = 1 "Trust/don't trust" boolean. Trust the answer if the */ 00202 /* reciprocal condition number is less than the threshold */ 00203 /* sqrt(n) * slamch('Epsilon'). */ 00204 00205 /* err = 2 "Guaranteed" error bound: The estimated forward error, */ 00206 /* almost certainly within a factor of 10 of the true error */ 00207 /* so long as the next entry is greater than the threshold */ 00208 /* sqrt(n) * slamch('Epsilon'). This error bound should only */ 00209 /* be trusted if the previous boolean is true. */ 00210 00211 /* err = 3 Reciprocal condition number: Estimated normwise */ 00212 /* reciprocal condition number. Compared with the threshold */ 00213 /* sqrt(n) * slamch('Epsilon') to determine if the error */ 00214 /* estimate is "guaranteed". These reciprocal condition */ 00215 /* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some */ 00216 /* appropriately scaled matrix Z. */ 00217 /* Let Z = S*A, where S scales each row by a power of the */ 00218 /* radix so all absolute row sums of Z are approximately 1. */ 00219 00220 /* This subroutine is only responsible for setting the second field */ 00221 /* above. */ 00222 /* See Lapack Working Note 165 for further details and extra */ 00223 /* cautions. */ 00224 00225 /* ERR_BNDS_COMP (input/output) REAL array, dimension (NRHS, N_ERR_BNDS) */ 00226 /* For each right-hand side, this array contains information about */ 00227 /* various error bounds and condition numbers corresponding to the */ 00228 /* componentwise relative error, which is defined as follows: */ 00229 00230 /* Componentwise relative error in the ith solution vector: */ 00231 /* abs(XTRUE(j,i) - X(j,i)) */ 00232 /* max_j ---------------------- */ 00233 /* abs(X(j,i)) */ 00234 00235 /* The array is indexed by the right-hand side i (on which the */ 00236 /* componentwise relative error depends), and the type of error */ 00237 /* information as described below. There currently are up to three */ 00238 /* pieces of information returned for each right-hand side. If */ 00239 /* componentwise accuracy is not requested (PARAMS(3) = 0.0), then */ 00240 /* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most */ 00241 /* the first (:,N_ERR_BNDS) entries are returned. */ 00242 00243 /* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith */ 00244 /* right-hand side. */ 00245 00246 /* The second index in ERR_BNDS_COMP(:,err) contains the following */ 00247 /* three fields: */ 00248 /* err = 1 "Trust/don't trust" boolean. Trust the answer if the */ 00249 /* reciprocal condition number is less than the threshold */ 00250 /* sqrt(n) * slamch('Epsilon'). */ 00251 00252 /* err = 2 "Guaranteed" error bound: The estimated forward error, */ 00253 /* almost certainly within a factor of 10 of the true error */ 00254 /* so long as the next entry is greater than the threshold */ 00255 /* sqrt(n) * slamch('Epsilon'). This error bound should only */ 00256 /* be trusted if the previous boolean is true. */ 00257 00258 /* err = 3 Reciprocal condition number: Estimated componentwise */ 00259 /* reciprocal condition number. Compared with the threshold */ 00260 /* sqrt(n) * slamch('Epsilon') to determine if the error */ 00261 /* estimate is "guaranteed". These reciprocal condition */ 00262 /* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some */ 00263 /* appropriately scaled matrix Z. */ 00264 /* Let Z = S*(A*diag(x)), where x is the solution for the */ 00265 /* current right-hand side and S scales each row of */ 00266 /* A*diag(x) by a power of the radix so all absolute row */ 00267 /* sums of Z are approximately 1. */ 00268 00269 /* This subroutine is only responsible for setting the second field */ 00270 /* above. */ 00271 /* See Lapack Working Note 165 for further details and extra */ 00272 /* cautions. */ 00273 00274 /* RES (input) REAL array, dimension (N) */ 00275 /* Workspace to hold the intermediate residual. */ 00276 00277 /* AYB (input) REAL array, dimension (N) */ 00278 /* Workspace. This can be the same workspace passed for Y_TAIL. */ 00279 00280 /* DY (input) REAL array, dimension (N) */ 00281 /* Workspace to hold the intermediate solution. */ 00282 00283 /* Y_TAIL (input) REAL array, dimension (N) */ 00284 /* Workspace to hold the trailing bits of the intermediate solution. */ 00285 00286 /* RCOND (input) REAL */ 00287 /* Reciprocal scaled condition number. This is an estimate of the */ 00288 /* reciprocal Skeel condition number of the matrix A after */ 00289 /* equilibration (if done). If this is less than the machine */ 00290 /* precision (in particular, if it is zero), the matrix is singular */ 00291 /* to working precision. Note that the error may still be small even */ 00292 /* if this number is very small and the matrix appears ill- */ 00293 /* conditioned. */ 00294 00295 /* ITHRESH (input) INTEGER */ 00296 /* The maximum number of residual computations allowed for */ 00297 /* refinement. The default is 10. For 'aggressive' set to 100 to */ 00298 /* permit convergence using approximate factorizations or */ 00299 /* factorizations other than LU. If the factorization uses a */ 00300 /* technique other than Gaussian elimination, the guarantees in */ 00301 /* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. */ 00302 00303 /* RTHRESH (input) REAL */ 00304 /* Determines when to stop refinement if the error estimate stops */ 00305 /* decreasing. Refinement will stop when the next solution no longer */ 00306 /* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is */ 00307 /* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The */ 00308 /* default value is 0.5. For 'aggressive' set to 0.9 to permit */ 00309 /* convergence on extremely ill-conditioned matrices. See LAWN 165 */ 00310 /* for more details. */ 00311 00312 /* DZ_UB (input) REAL */ 00313 /* Determines when to start considering componentwise convergence. */ 00314 /* Componentwise convergence is only considered after each component */ 00315 /* of the solution Y is stable, which we definte as the relative */ 00316 /* change in each component being less than DZ_UB. The default value */ 00317 /* is 0.25, requiring the first bit to be stable. See LAWN 165 for */ 00318 /* more details. */ 00319 00320 /* IGNORE_CWISE (input) LOGICAL */ 00321 /* If .TRUE. then ignore componentwise convergence. Default value */ 00322 /* is .FALSE.. */ 00323 00324 /* INFO (output) INTEGER */ 00325 /* = 0: Successful exit. */ 00326 /* < 0: if INFO = -i, the ith argument to SSYTRS had an illegal */ 00327 /* value */ 00328 00329 /* ===================================================================== */ 00330 00331 /* .. Local Scalars .. */ 00332 /* .. */ 00333 /* .. Parameters .. */ 00334 /* .. */ 00335 /* .. External Functions .. */ 00336 /* .. */ 00337 /* .. External Subroutines .. */ 00338 /* .. */ 00339 /* .. Intrinsic Functions .. */ 00340 /* .. */ 00341 /* .. Executable Statements .. */ 00342 00343 /* Parameter adjustments */ 00344 err_bnds_comp_dim1 = *nrhs; 00345 err_bnds_comp_offset = 1 + err_bnds_comp_dim1; 00346 err_bnds_comp__ -= err_bnds_comp_offset; 00347 err_bnds_norm_dim1 = *nrhs; 00348 err_bnds_norm_offset = 1 + err_bnds_norm_dim1; 00349 err_bnds_norm__ -= err_bnds_norm_offset; 00350 a_dim1 = *lda; 00351 a_offset = 1 + a_dim1; 00352 a -= a_offset; 00353 af_dim1 = *ldaf; 00354 af_offset = 1 + af_dim1; 00355 af -= af_offset; 00356 --ipiv; 00357 --c__; 00358 b_dim1 = *ldb; 00359 b_offset = 1 + b_dim1; 00360 b -= b_offset; 00361 y_dim1 = *ldy; 00362 y_offset = 1 + y_dim1; 00363 y -= y_offset; 00364 --berr_out__; 00365 --res; 00366 --ayb; 00367 --dy; 00368 --y_tail__; 00369 00370 /* Function Body */ 00371 if (*info != 0) { 00372 return 0; 00373 } 00374 eps = slamch_("Epsilon"); 00375 hugeval = slamch_("Overflow"); 00376 /* Force HUGEVAL to Inf */ 00377 hugeval *= hugeval; 00378 /* Using HUGEVAL may lead to spurious underflows. */ 00379 incr_thresh__ = (real) (*n) * eps; 00380 if (lsame_(uplo, "L")) { 00381 uplo2 = ilauplo_("L"); 00382 } else { 00383 uplo2 = ilauplo_("U"); 00384 } 00385 i__1 = *nrhs; 00386 for (j = 1; j <= i__1; ++j) { 00387 y_prec_state__ = 1; 00388 if (y_prec_state__ == 2) { 00389 i__2 = *n; 00390 for (i__ = 1; i__ <= i__2; ++i__) { 00391 y_tail__[i__] = 0.f; 00392 } 00393 } 00394 dxrat = 0.f; 00395 dxratmax = 0.f; 00396 dzrat = 0.f; 00397 dzratmax = 0.f; 00398 final_dx_x__ = hugeval; 00399 final_dz_z__ = hugeval; 00400 prevnormdx = hugeval; 00401 prev_dz_z__ = hugeval; 00402 dz_z__ = hugeval; 00403 dx_x__ = hugeval; 00404 x_state__ = 1; 00405 z_state__ = 0; 00406 incr_prec__ = FALSE_; 00407 i__2 = *ithresh; 00408 for (cnt = 1; cnt <= i__2; ++cnt) { 00409 00410 /* Compute residual RES = B_s - op(A_s) * Y, */ 00411 /* op(A) = A, A**T, or A**H depending on TRANS (and type). */ 00412 00413 scopy_(n, &b[j * b_dim1 + 1], &c__1, &res[1], &c__1); 00414 if (y_prec_state__ == 0) { 00415 ssymv_(uplo, n, &c_b9, &a[a_offset], lda, &y[j * y_dim1 + 1], 00416 &c__1, &c_b11, &res[1], &c__1); 00417 } else if (y_prec_state__ == 1) { 00418 blas_ssymv_x__(&uplo2, n, &c_b9, &a[a_offset], lda, &y[j * 00419 y_dim1 + 1], &c__1, &c_b11, &res[1], &c__1, 00420 prec_type__); 00421 } else { 00422 blas_ssymv2_x__(&uplo2, n, &c_b9, &a[a_offset], lda, &y[j * 00423 y_dim1 + 1], &y_tail__[1], &c__1, &c_b11, &res[1], & 00424 c__1, prec_type__); 00425 } 00426 /* XXX: RES is no longer needed. */ 00427 scopy_(n, &res[1], &c__1, &dy[1], &c__1); 00428 ssytrs_(uplo, n, nrhs, &af[af_offset], ldaf, &ipiv[1], &dy[1], n, 00429 info); 00430 00431 /* Calculate relative changes DX_X, DZ_Z and ratios DXRAT, DZRAT. */ 00432 00433 normx = 0.f; 00434 normy = 0.f; 00435 normdx = 0.f; 00436 dz_z__ = 0.f; 00437 ymin = hugeval; 00438 i__3 = *n; 00439 for (i__ = 1; i__ <= i__3; ++i__) { 00440 yk = (r__1 = y[i__ + j * y_dim1], dabs(r__1)); 00441 dyk = (r__1 = dy[i__], dabs(r__1)); 00442 if (yk != 0.f) { 00443 /* Computing MAX */ 00444 r__1 = dz_z__, r__2 = dyk / yk; 00445 dz_z__ = dmax(r__1,r__2); 00446 } else if (dyk != 0.f) { 00447 dz_z__ = hugeval; 00448 } 00449 ymin = dmin(ymin,yk); 00450 normy = dmax(normy,yk); 00451 if (*colequ) { 00452 /* Computing MAX */ 00453 r__1 = normx, r__2 = yk * c__[i__]; 00454 normx = dmax(r__1,r__2); 00455 /* Computing MAX */ 00456 r__1 = normdx, r__2 = dyk * c__[i__]; 00457 normdx = dmax(r__1,r__2); 00458 } else { 00459 normx = normy; 00460 normdx = dmax(normdx,dyk); 00461 } 00462 } 00463 if (normx != 0.f) { 00464 dx_x__ = normdx / normx; 00465 } else if (normdx == 0.f) { 00466 dx_x__ = 0.f; 00467 } else { 00468 dx_x__ = hugeval; 00469 } 00470 dxrat = normdx / prevnormdx; 00471 dzrat = dz_z__ / prev_dz_z__; 00472 00473 /* Check termination criteria. */ 00474 00475 if (ymin * *rcond < incr_thresh__ * normy && y_prec_state__ < 2) { 00476 incr_prec__ = TRUE_; 00477 } 00478 if (x_state__ == 3 && dxrat <= *rthresh) { 00479 x_state__ = 1; 00480 } 00481 if (x_state__ == 1) { 00482 if (dx_x__ <= eps) { 00483 x_state__ = 2; 00484 } else if (dxrat > *rthresh) { 00485 if (y_prec_state__ != 2) { 00486 incr_prec__ = TRUE_; 00487 } else { 00488 x_state__ = 3; 00489 } 00490 } else { 00491 if (dxrat > dxratmax) { 00492 dxratmax = dxrat; 00493 } 00494 } 00495 if (x_state__ > 1) { 00496 final_dx_x__ = dx_x__; 00497 } 00498 } 00499 if (z_state__ == 0 && dz_z__ <= *dz_ub__) { 00500 z_state__ = 1; 00501 } 00502 if (z_state__ == 3 && dzrat <= *rthresh) { 00503 z_state__ = 1; 00504 } 00505 if (z_state__ == 1) { 00506 if (dz_z__ <= eps) { 00507 z_state__ = 2; 00508 } else if (dz_z__ > *dz_ub__) { 00509 z_state__ = 0; 00510 dzratmax = 0.f; 00511 final_dz_z__ = hugeval; 00512 } else if (dzrat > *rthresh) { 00513 if (y_prec_state__ != 2) { 00514 incr_prec__ = TRUE_; 00515 } else { 00516 z_state__ = 3; 00517 } 00518 } else { 00519 if (dzrat > dzratmax) { 00520 dzratmax = dzrat; 00521 } 00522 } 00523 if (z_state__ > 1) { 00524 final_dz_z__ = dz_z__; 00525 } 00526 } 00527 if (x_state__ != 1 && (*ignore_cwise__ || z_state__ != 1)) { 00528 goto L666; 00529 } 00530 if (incr_prec__) { 00531 incr_prec__ = FALSE_; 00532 ++y_prec_state__; 00533 i__3 = *n; 00534 for (i__ = 1; i__ <= i__3; ++i__) { 00535 y_tail__[i__] = 0.f; 00536 } 00537 } 00538 prevnormdx = normdx; 00539 prev_dz_z__ = dz_z__; 00540 00541 /* Update soluton. */ 00542 00543 if (y_prec_state__ < 2) { 00544 saxpy_(n, &c_b11, &dy[1], &c__1, &y[j * y_dim1 + 1], &c__1); 00545 } else { 00546 sla_wwaddw__(n, &y[j * y_dim1 + 1], &y_tail__[1], &dy[1]); 00547 } 00548 } 00549 /* Target of "IF (Z_STOP .AND. X_STOP)". Sun's f77 won't EXIT. */ 00550 L666: 00551 00552 /* Set final_* when cnt hits ithresh. */ 00553 00554 if (x_state__ == 1) { 00555 final_dx_x__ = dx_x__; 00556 } 00557 if (z_state__ == 1) { 00558 final_dz_z__ = dz_z__; 00559 } 00560 00561 /* Compute error bounds. */ 00562 00563 if (*n_norms__ >= 1) { 00564 err_bnds_norm__[j + (err_bnds_norm_dim1 << 1)] = final_dx_x__ / ( 00565 1 - dxratmax); 00566 } 00567 if (*n_norms__ >= 2) { 00568 err_bnds_comp__[j + (err_bnds_comp_dim1 << 1)] = final_dz_z__ / ( 00569 1 - dzratmax); 00570 } 00571 00572 /* Compute componentwise relative backward error from formula */ 00573 /* max(i) ( abs(R(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) */ 00574 /* where abs(Z) is the componentwise absolute value of the matrix */ 00575 /* or vector Z. */ 00576 00577 /* Compute residual RES = B_s - op(A_s) * Y, */ 00578 /* op(A) = A, A**T, or A**H depending on TRANS (and type). */ 00579 scopy_(n, &b[j * b_dim1 + 1], &c__1, &res[1], &c__1); 00580 ssymv_(uplo, n, &c_b9, &a[a_offset], lda, &y[j * y_dim1 + 1], &c__1, & 00581 c_b11, &res[1], &c__1); 00582 i__2 = *n; 00583 for (i__ = 1; i__ <= i__2; ++i__) { 00584 ayb[i__] = (r__1 = b[i__ + j * b_dim1], dabs(r__1)); 00585 } 00586 00587 /* Compute abs(op(A_s))*abs(Y) + abs(B_s). */ 00588 00589 sla_syamv__(&uplo2, n, &c_b11, &a[a_offset], lda, &y[j * y_dim1 + 1], 00590 &c__1, &c_b11, &ayb[1], &c__1); 00591 sla_lin_berr__(n, n, &c__1, &res[1], &ayb[1], &berr_out__[j]); 00592 00593 /* End of loop for each RHS. */ 00594 00595 } 00596 00597 return 0; 00598 } /* sla_syrfsx_extended__ */