00001 /* zsyrfsx.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 logical c_true = TRUE_; 00019 static logical c_false = FALSE_; 00020 00021 /* Subroutine */ int zsyrfsx_(char *uplo, char *equed, integer *n, integer * 00022 nrhs, doublecomplex *a, integer *lda, doublecomplex *af, integer * 00023 ldaf, integer *ipiv, doublereal *s, doublecomplex *b, integer *ldb, 00024 doublecomplex *x, integer *ldx, doublereal *rcond, doublereal *berr, 00025 integer *n_err_bnds__, doublereal *err_bnds_norm__, doublereal * 00026 err_bnds_comp__, integer *nparams, doublereal *params, doublecomplex * 00027 work, doublereal *rwork, integer *info) 00028 { 00029 /* System generated locals */ 00030 integer a_dim1, a_offset, af_dim1, af_offset, b_dim1, b_offset, x_dim1, 00031 x_offset, err_bnds_norm_dim1, err_bnds_norm_offset, 00032 err_bnds_comp_dim1, err_bnds_comp_offset, i__1; 00033 doublereal d__1, d__2; 00034 00035 /* Builtin functions */ 00036 double sqrt(doublereal); 00037 00038 /* Local variables */ 00039 doublereal illrcond_thresh__, unstable_thresh__, err_lbnd__; 00040 integer ref_type__; 00041 integer j; 00042 doublereal rcond_tmp__; 00043 integer prec_type__; 00044 doublereal cwise_wrong__; 00045 char norm[1]; 00046 extern /* Subroutine */ int zla_syrfsx_extended__(integer *, char *, 00047 integer *, integer *, doublecomplex *, integer *, doublecomplex *, 00048 integer *, integer *, logical *, doublereal *, doublecomplex *, 00049 integer *, doublecomplex *, integer *, doublereal *, integer *, 00050 doublereal *, doublereal *, doublecomplex *, doublereal *, 00051 doublecomplex *, doublecomplex *, doublereal *, integer *, 00052 doublereal *, doublereal *, logical *, integer *, ftnlen); 00053 logical ignore_cwise__; 00054 extern logical lsame_(char *, char *); 00055 doublereal anorm; 00056 logical rcequ; 00057 extern doublereal zla_syrcond_c__(char *, integer *, doublecomplex *, 00058 integer *, doublecomplex *, integer *, integer *, doublereal *, 00059 logical *, integer *, doublecomplex *, doublereal *, ftnlen), 00060 zla_syrcond_x__(char *, integer *, doublecomplex *, integer *, 00061 doublecomplex *, integer *, integer *, doublecomplex *, integer *, 00062 doublecomplex *, doublereal *, ftnlen), dlamch_(char *); 00063 extern /* Subroutine */ int xerbla_(char *, integer *); 00064 extern doublereal zlansy_(char *, char *, integer *, doublecomplex *, 00065 integer *, doublereal *); 00066 extern /* Subroutine */ int zsycon_(char *, integer *, doublecomplex *, 00067 integer *, integer *, doublereal *, doublereal *, doublecomplex *, 00068 integer *); 00069 extern integer ilaprec_(char *); 00070 integer ithresh, n_norms__; 00071 doublereal rthresh; 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 /* ZSYRFSX improves the computed solution to a system of linear */ 00092 /* equations when the coefficient matrix is symmetric indefinite, and */ 00093 /* provides error bounds and backward error estimates for the */ 00094 /* solution. In addition to normwise error bound, the code provides */ 00095 /* maximum componentwise error bound if possible. See comments for */ 00096 /* ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. */ 00097 00098 /* The original system of linear equations may have been equilibrated */ 00099 /* before calling this routine, as described by arguments EQUED and S */ 00100 /* below. In this case, the solution and error bounds returned are */ 00101 /* for the original unequilibrated system. */ 00102 00103 /* Arguments */ 00104 /* ========= */ 00105 00106 /* Some optional parameters are bundled in the PARAMS array. These */ 00107 /* settings determine how refinement is performed, but often the */ 00108 /* defaults are acceptable. If the defaults are acceptable, users */ 00109 /* can pass NPARAMS = 0 which prevents the source code from accessing */ 00110 /* the PARAMS argument. */ 00111 00112 /* UPLO (input) CHARACTER*1 */ 00113 /* = 'U': Upper triangle of A is stored; */ 00114 /* = 'L': Lower triangle of A is stored. */ 00115 00116 /* EQUED (input) CHARACTER*1 */ 00117 /* Specifies the form of equilibration that was done to A */ 00118 /* before calling this routine. This is needed to compute */ 00119 /* the solution and error bounds correctly. */ 00120 /* = 'N': No equilibration */ 00121 /* = 'Y': Both row and column equilibration, i.e., A has been */ 00122 /* replaced by diag(S) * A * diag(S). */ 00123 /* The right hand side B has been changed accordingly. */ 00124 00125 /* N (input) INTEGER */ 00126 /* The order of the matrix A. N >= 0. */ 00127 00128 /* NRHS (input) INTEGER */ 00129 /* The number of right hand sides, i.e., the number of columns */ 00130 /* of the matrices B and X. NRHS >= 0. */ 00131 00132 /* A (input) COMPLEX*16 array, dimension (LDA,N) */ 00133 /* The symmetric matrix A. If UPLO = 'U', the leading N-by-N */ 00134 /* upper triangular part of A contains the upper triangular */ 00135 /* part of the matrix A, and the strictly lower triangular */ 00136 /* part of A is not referenced. If UPLO = 'L', the leading */ 00137 /* N-by-N lower triangular part of A contains the lower */ 00138 /* triangular part of the matrix A, and the strictly upper */ 00139 /* triangular part of A is not referenced. */ 00140 00141 /* LDA (input) INTEGER */ 00142 /* The leading dimension of the array A. LDA >= max(1,N). */ 00143 00144 /* AF (input) COMPLEX*16 array, dimension (LDAF,N) */ 00145 /* The factored form of the matrix A. AF contains the block */ 00146 /* diagonal matrix D and the multipliers used to obtain the */ 00147 /* factor U or L from the factorization A = U*D*U**T or A = */ 00148 /* L*D*L**T as computed by DSYTRF. */ 00149 00150 /* LDAF (input) INTEGER */ 00151 /* The leading dimension of the array AF. LDAF >= max(1,N). */ 00152 00153 /* IPIV (input) INTEGER array, dimension (N) */ 00154 /* Details of the interchanges and the block structure of D */ 00155 /* as determined by DSYTRF. */ 00156 00157 /* S (input or output) DOUBLE PRECISION array, dimension (N) */ 00158 /* The scale factors for A. If EQUED = 'Y', A is multiplied on */ 00159 /* the left and right by diag(S). S is an input argument if FACT = */ 00160 /* 'F'; otherwise, S is an output argument. If FACT = 'F' and EQUED */ 00161 /* = 'Y', each element of S must be positive. If S is output, each */ 00162 /* element of S is a power of the radix. If S is input, each element */ 00163 /* of S should be a power of the radix to ensure a reliable solution */ 00164 /* and error estimates. Scaling by powers of the radix does not cause */ 00165 /* rounding errors unless the result underflows or overflows. */ 00166 /* Rounding errors during scaling lead to refining with a matrix that */ 00167 /* is not equivalent to the input matrix, producing error estimates */ 00168 /* that may not be reliable. */ 00169 00170 /* B (input) COMPLEX*16 array, dimension (LDB,NRHS) */ 00171 /* The right hand side matrix B. */ 00172 00173 /* LDB (input) INTEGER */ 00174 /* The leading dimension of the array B. LDB >= max(1,N). */ 00175 00176 /* X (input/output) COMPLEX*16 array, dimension (LDX,NRHS) */ 00177 /* On entry, the solution matrix X, as computed by DGETRS. */ 00178 /* On exit, the improved solution matrix X. */ 00179 00180 /* LDX (input) INTEGER */ 00181 /* The leading dimension of the array X. LDX >= max(1,N). */ 00182 00183 /* RCOND (output) DOUBLE PRECISION */ 00184 /* Reciprocal scaled condition number. This is an estimate of the */ 00185 /* reciprocal Skeel condition number of the matrix A after */ 00186 /* equilibration (if done). If this is less than the machine */ 00187 /* precision (in particular, if it is zero), the matrix is singular */ 00188 /* to working precision. Note that the error may still be small even */ 00189 /* if this number is very small and the matrix appears ill- */ 00190 /* conditioned. */ 00191 00192 /* BERR (output) DOUBLE PRECISION array, dimension (NRHS) */ 00193 /* Componentwise relative backward error. This is the */ 00194 /* componentwise relative backward error of each solution vector X(j) */ 00195 /* (i.e., the smallest relative change in any element of A or B that */ 00196 /* makes X(j) an exact solution). */ 00197 00198 /* N_ERR_BNDS (input) INTEGER */ 00199 /* Number of error bounds to return for each right hand side */ 00200 /* and each type (normwise or componentwise). See ERR_BNDS_NORM and */ 00201 /* ERR_BNDS_COMP below. */ 00202 00203 /* ERR_BNDS_NORM (output) DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS) */ 00204 /* For each right-hand side, this array contains information about */ 00205 /* various error bounds and condition numbers corresponding to the */ 00206 /* normwise relative error, which is defined as follows: */ 00207 00208 /* Normwise relative error in the ith solution vector: */ 00209 /* max_j (abs(XTRUE(j,i) - X(j,i))) */ 00210 /* ------------------------------ */ 00211 /* max_j abs(X(j,i)) */ 00212 00213 /* The array is indexed by the type of error information as described */ 00214 /* below. There currently are up to three pieces of information */ 00215 /* returned. */ 00216 00217 /* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith */ 00218 /* right-hand side. */ 00219 00220 /* The second index in ERR_BNDS_NORM(:,err) contains the following */ 00221 /* three fields: */ 00222 /* err = 1 "Trust/don't trust" boolean. Trust the answer if the */ 00223 /* reciprocal condition number is less than the threshold */ 00224 /* sqrt(n) * dlamch('Epsilon'). */ 00225 00226 /* err = 2 "Guaranteed" error bound: The estimated forward error, */ 00227 /* almost certainly within a factor of 10 of the true error */ 00228 /* so long as the next entry is greater than the threshold */ 00229 /* sqrt(n) * dlamch('Epsilon'). This error bound should only */ 00230 /* be trusted if the previous boolean is true. */ 00231 00232 /* err = 3 Reciprocal condition number: Estimated normwise */ 00233 /* reciprocal condition number. Compared with the threshold */ 00234 /* sqrt(n) * dlamch('Epsilon') to determine if the error */ 00235 /* estimate is "guaranteed". These reciprocal condition */ 00236 /* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some */ 00237 /* appropriately scaled matrix Z. */ 00238 /* Let Z = S*A, where S scales each row by a power of the */ 00239 /* radix so all absolute row sums of Z are approximately 1. */ 00240 00241 /* See Lapack Working Note 165 for further details and extra */ 00242 /* cautions. */ 00243 00244 /* ERR_BNDS_COMP (output) DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS) */ 00245 /* For each right-hand side, this array contains information about */ 00246 /* various error bounds and condition numbers corresponding to the */ 00247 /* componentwise relative error, which is defined as follows: */ 00248 00249 /* Componentwise relative error in the ith solution vector: */ 00250 /* abs(XTRUE(j,i) - X(j,i)) */ 00251 /* max_j ---------------------- */ 00252 /* abs(X(j,i)) */ 00253 00254 /* The array is indexed by the right-hand side i (on which the */ 00255 /* componentwise relative error depends), and the type of error */ 00256 /* information as described below. There currently are up to three */ 00257 /* pieces of information returned for each right-hand side. If */ 00258 /* componentwise accuracy is not requested (PARAMS(3) = 0.0), then */ 00259 /* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most */ 00260 /* the first (:,N_ERR_BNDS) entries are returned. */ 00261 00262 /* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith */ 00263 /* right-hand side. */ 00264 00265 /* The second index in ERR_BNDS_COMP(:,err) contains the following */ 00266 /* three fields: */ 00267 /* err = 1 "Trust/don't trust" boolean. Trust the answer if the */ 00268 /* reciprocal condition number is less than the threshold */ 00269 /* sqrt(n) * dlamch('Epsilon'). */ 00270 00271 /* err = 2 "Guaranteed" error bound: The estimated forward error, */ 00272 /* almost certainly within a factor of 10 of the true error */ 00273 /* so long as the next entry is greater than the threshold */ 00274 /* sqrt(n) * dlamch('Epsilon'). This error bound should only */ 00275 /* be trusted if the previous boolean is true. */ 00276 00277 /* err = 3 Reciprocal condition number: Estimated componentwise */ 00278 /* reciprocal condition number. Compared with the threshold */ 00279 /* sqrt(n) * dlamch('Epsilon') to determine if the error */ 00280 /* estimate is "guaranteed". These reciprocal condition */ 00281 /* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some */ 00282 /* appropriately scaled matrix Z. */ 00283 /* Let Z = S*(A*diag(x)), where x is the solution for the */ 00284 /* current right-hand side and S scales each row of */ 00285 /* A*diag(x) by a power of the radix so all absolute row */ 00286 /* sums of Z are approximately 1. */ 00287 00288 /* See Lapack Working Note 165 for further details and extra */ 00289 /* cautions. */ 00290 00291 /* NPARAMS (input) INTEGER */ 00292 /* Specifies the number of parameters set in PARAMS. If .LE. 0, the */ 00293 /* PARAMS array is never referenced and default values are used. */ 00294 00295 /* PARAMS (input / output) DOUBLE PRECISION array, dimension NPARAMS */ 00296 /* Specifies algorithm parameters. If an entry is .LT. 0.0, then */ 00297 /* that entry will be filled with default value used for that */ 00298 /* parameter. Only positions up to NPARAMS are accessed; defaults */ 00299 /* are used for higher-numbered parameters. */ 00300 00301 /* PARAMS(LA_LINRX_ITREF_I = 1) : Whether to perform iterative */ 00302 /* refinement or not. */ 00303 /* Default: 1.0D+0 */ 00304 /* = 0.0 : No refinement is performed, and no error bounds are */ 00305 /* computed. */ 00306 /* = 1.0 : Use the double-precision refinement algorithm, */ 00307 /* possibly with doubled-single computations if the */ 00308 /* compilation environment does not support DOUBLE */ 00309 /* PRECISION. */ 00310 /* (other values are reserved for future use) */ 00311 00312 /* PARAMS(LA_LINRX_ITHRESH_I = 2) : Maximum number of residual */ 00313 /* computations allowed for refinement. */ 00314 /* Default: 10 */ 00315 /* Aggressive: Set to 100 to permit convergence using approximate */ 00316 /* factorizations or factorizations other than LU. If */ 00317 /* the factorization uses a technique other than */ 00318 /* Gaussian elimination, the guarantees in */ 00319 /* err_bnds_norm and err_bnds_comp may no longer be */ 00320 /* trustworthy. */ 00321 00322 /* PARAMS(LA_LINRX_CWISE_I = 3) : Flag determining if the code */ 00323 /* will attempt to find a solution with small componentwise */ 00324 /* relative error in the double-precision algorithm. Positive */ 00325 /* is true, 0.0 is false. */ 00326 /* Default: 1.0 (attempt componentwise convergence) */ 00327 00328 /* WORK (workspace) COMPLEX*16 array, dimension (2*N) */ 00329 00330 /* RWORK (workspace) DOUBLE PRECISION array, dimension (2*N) */ 00331 00332 /* INFO (output) INTEGER */ 00333 /* = 0: Successful exit. The solution to every right-hand side is */ 00334 /* guaranteed. */ 00335 /* < 0: If INFO = -i, the i-th argument had an illegal value */ 00336 /* > 0 and <= N: U(INFO,INFO) is exactly zero. The factorization */ 00337 /* has been completed, but the factor U is exactly singular, so */ 00338 /* the solution and error bounds could not be computed. RCOND = 0 */ 00339 /* is returned. */ 00340 /* = N+J: The solution corresponding to the Jth right-hand side is */ 00341 /* not guaranteed. The solutions corresponding to other right- */ 00342 /* hand sides K with K > J may not be guaranteed as well, but */ 00343 /* only the first such right-hand side is reported. If a small */ 00344 /* componentwise error is not requested (PARAMS(3) = 0.0) then */ 00345 /* the Jth right-hand side is the first with a normwise error */ 00346 /* bound that is not guaranteed (the smallest J such */ 00347 /* that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) */ 00348 /* the Jth right-hand side is the first with either a normwise or */ 00349 /* componentwise error bound that is not guaranteed (the smallest */ 00350 /* J such that either ERR_BNDS_NORM(J,1) = 0.0 or */ 00351 /* ERR_BNDS_COMP(J,1) = 0.0). See the definition of */ 00352 /* ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information */ 00353 /* about all of the right-hand sides check ERR_BNDS_NORM or */ 00354 /* ERR_BNDS_COMP. */ 00355 00356 /* ================================================================== */ 00357 00358 /* .. Parameters .. */ 00359 /* .. */ 00360 /* .. Local Scalars .. */ 00361 /* .. */ 00362 /* .. External Subroutines .. */ 00363 /* .. */ 00364 /* .. Intrinsic Functions .. */ 00365 /* .. */ 00366 /* .. External Functions .. */ 00367 /* .. */ 00368 /* .. Executable Statements .. */ 00369 00370 /* Check the input parameters. */ 00371 00372 /* Parameter adjustments */ 00373 err_bnds_comp_dim1 = *nrhs; 00374 err_bnds_comp_offset = 1 + err_bnds_comp_dim1; 00375 err_bnds_comp__ -= err_bnds_comp_offset; 00376 err_bnds_norm_dim1 = *nrhs; 00377 err_bnds_norm_offset = 1 + err_bnds_norm_dim1; 00378 err_bnds_norm__ -= err_bnds_norm_offset; 00379 a_dim1 = *lda; 00380 a_offset = 1 + a_dim1; 00381 a -= a_offset; 00382 af_dim1 = *ldaf; 00383 af_offset = 1 + af_dim1; 00384 af -= af_offset; 00385 --ipiv; 00386 --s; 00387 b_dim1 = *ldb; 00388 b_offset = 1 + b_dim1; 00389 b -= b_offset; 00390 x_dim1 = *ldx; 00391 x_offset = 1 + x_dim1; 00392 x -= x_offset; 00393 --berr; 00394 --params; 00395 --work; 00396 --rwork; 00397 00398 /* Function Body */ 00399 *info = 0; 00400 ref_type__ = 1; 00401 if (*nparams >= 1) { 00402 if (params[1] < 0.) { 00403 params[1] = 1.; 00404 } else { 00405 ref_type__ = (integer) params[1]; 00406 } 00407 } 00408 00409 /* Set default parameters. */ 00410 00411 illrcond_thresh__ = (doublereal) (*n) * dlamch_("Epsilon"); 00412 ithresh = 10; 00413 rthresh = .5; 00414 unstable_thresh__ = .25; 00415 ignore_cwise__ = FALSE_; 00416 00417 if (*nparams >= 2) { 00418 if (params[2] < 0.) { 00419 params[2] = (doublereal) ithresh; 00420 } else { 00421 ithresh = (integer) params[2]; 00422 } 00423 } 00424 if (*nparams >= 3) { 00425 if (params[3] < 0.) { 00426 if (ignore_cwise__) { 00427 params[3] = 0.; 00428 } else { 00429 params[3] = 1.; 00430 } 00431 } else { 00432 ignore_cwise__ = params[3] == 0.; 00433 } 00434 } 00435 if (ref_type__ == 0 || *n_err_bnds__ == 0) { 00436 n_norms__ = 0; 00437 } else if (ignore_cwise__) { 00438 n_norms__ = 1; 00439 } else { 00440 n_norms__ = 2; 00441 } 00442 00443 rcequ = lsame_(equed, "Y"); 00444 00445 /* Test input parameters. */ 00446 00447 if (! lsame_(uplo, "U") && ! lsame_(uplo, "L")) { 00448 *info = -1; 00449 } else if (! rcequ && ! lsame_(equed, "N")) { 00450 *info = -2; 00451 } else if (*n < 0) { 00452 *info = -3; 00453 } else if (*nrhs < 0) { 00454 *info = -4; 00455 } else if (*lda < max(1,*n)) { 00456 *info = -6; 00457 } else if (*ldaf < max(1,*n)) { 00458 *info = -8; 00459 } else if (*ldb < max(1,*n)) { 00460 *info = -11; 00461 } else if (*ldx < max(1,*n)) { 00462 *info = -13; 00463 } 00464 if (*info != 0) { 00465 i__1 = -(*info); 00466 xerbla_("ZSYRFSX", &i__1); 00467 return 0; 00468 } 00469 00470 /* Quick return if possible. */ 00471 00472 if (*n == 0 || *nrhs == 0) { 00473 *rcond = 1.; 00474 i__1 = *nrhs; 00475 for (j = 1; j <= i__1; ++j) { 00476 berr[j] = 0.; 00477 if (*n_err_bnds__ >= 1) { 00478 err_bnds_norm__[j + err_bnds_norm_dim1] = 1.; 00479 err_bnds_comp__[j + err_bnds_comp_dim1] = 1.; 00480 } else if (*n_err_bnds__ >= 2) { 00481 err_bnds_norm__[j + (err_bnds_norm_dim1 << 1)] = 0.; 00482 err_bnds_comp__[j + (err_bnds_comp_dim1 << 1)] = 0.; 00483 } else if (*n_err_bnds__ >= 3) { 00484 err_bnds_norm__[j + err_bnds_norm_dim1 * 3] = 1.; 00485 err_bnds_comp__[j + err_bnds_comp_dim1 * 3] = 1.; 00486 } 00487 } 00488 return 0; 00489 } 00490 00491 /* Default to failure. */ 00492 00493 *rcond = 0.; 00494 i__1 = *nrhs; 00495 for (j = 1; j <= i__1; ++j) { 00496 berr[j] = 1.; 00497 if (*n_err_bnds__ >= 1) { 00498 err_bnds_norm__[j + err_bnds_norm_dim1] = 1.; 00499 err_bnds_comp__[j + err_bnds_comp_dim1] = 1.; 00500 } else if (*n_err_bnds__ >= 2) { 00501 err_bnds_norm__[j + (err_bnds_norm_dim1 << 1)] = 1.; 00502 err_bnds_comp__[j + (err_bnds_comp_dim1 << 1)] = 1.; 00503 } else if (*n_err_bnds__ >= 3) { 00504 err_bnds_norm__[j + err_bnds_norm_dim1 * 3] = 0.; 00505 err_bnds_comp__[j + err_bnds_comp_dim1 * 3] = 0.; 00506 } 00507 } 00508 00509 /* Compute the norm of A and the reciprocal of the condition */ 00510 /* number of A. */ 00511 00512 *(unsigned char *)norm = 'I'; 00513 anorm = zlansy_(norm, uplo, n, &a[a_offset], lda, &rwork[1]); 00514 zsycon_(uplo, n, &af[af_offset], ldaf, &ipiv[1], &anorm, rcond, &work[1], 00515 info); 00516 00517 /* Perform refinement on each right-hand side */ 00518 00519 if (ref_type__ != 0) { 00520 prec_type__ = ilaprec_("E"); 00521 zla_syrfsx_extended__(&prec_type__, uplo, n, nrhs, &a[a_offset], lda, 00522 &af[af_offset], ldaf, &ipiv[1], &rcequ, &s[1], &b[b_offset], 00523 ldb, &x[x_offset], ldx, &berr[1], &n_norms__, & 00524 err_bnds_norm__[err_bnds_norm_offset], &err_bnds_comp__[ 00525 err_bnds_comp_offset], &work[1], &rwork[1], &work[*n + 1], 00526 (doublecomplex *)(&rwork[1]), rcond, &ithresh, &rthresh, &unstable_thresh__, & 00527 ignore_cwise__, info, (ftnlen)1); 00528 } 00529 /* Computing MAX */ 00530 d__1 = 10., d__2 = sqrt((doublereal) (*n)); 00531 err_lbnd__ = max(d__1,d__2) * dlamch_("Epsilon"); 00532 if (*n_err_bnds__ >= 1 && n_norms__ >= 1) { 00533 00534 /* Compute scaled normwise condition number cond(A*C). */ 00535 00536 if (rcequ) { 00537 rcond_tmp__ = zla_syrcond_c__(uplo, n, &a[a_offset], lda, &af[ 00538 af_offset], ldaf, &ipiv[1], &s[1], &c_true, info, &work[1] 00539 , &rwork[1], (ftnlen)1); 00540 } else { 00541 rcond_tmp__ = zla_syrcond_c__(uplo, n, &a[a_offset], lda, &af[ 00542 af_offset], ldaf, &ipiv[1], &s[1], &c_false, info, &work[ 00543 1], &rwork[1], (ftnlen)1); 00544 } 00545 i__1 = *nrhs; 00546 for (j = 1; j <= i__1; ++j) { 00547 00548 /* Cap the error at 1.0. */ 00549 00550 if (*n_err_bnds__ >= 2 && err_bnds_norm__[j + (err_bnds_norm_dim1 00551 << 1)] > 1.) { 00552 err_bnds_norm__[j + (err_bnds_norm_dim1 << 1)] = 1.; 00553 } 00554 00555 /* Threshold the error (see LAWN). */ 00556 00557 if (rcond_tmp__ < illrcond_thresh__) { 00558 err_bnds_norm__[j + (err_bnds_norm_dim1 << 1)] = 1.; 00559 err_bnds_norm__[j + err_bnds_norm_dim1] = 0.; 00560 if (*info <= *n) { 00561 *info = *n + j; 00562 } 00563 } else if (err_bnds_norm__[j + (err_bnds_norm_dim1 << 1)] < 00564 err_lbnd__) { 00565 err_bnds_norm__[j + (err_bnds_norm_dim1 << 1)] = err_lbnd__; 00566 err_bnds_norm__[j + err_bnds_norm_dim1] = 1.; 00567 } 00568 00569 /* Save the condition number. */ 00570 00571 if (*n_err_bnds__ >= 3) { 00572 err_bnds_norm__[j + err_bnds_norm_dim1 * 3] = rcond_tmp__; 00573 } 00574 } 00575 } 00576 if (*n_err_bnds__ >= 1 && n_norms__ >= 2) { 00577 00578 /* Compute componentwise condition number cond(A*diag(Y(:,J))) for */ 00579 /* each right-hand side using the current solution as an estimate of */ 00580 /* the true solution. If the componentwise error estimate is too */ 00581 /* large, then the solution is a lousy estimate of truth and the */ 00582 /* estimated RCOND may be too optimistic. To avoid misleading users, */ 00583 /* the inverse condition number is set to 0.0 when the estimated */ 00584 /* cwise error is at least CWISE_WRONG. */ 00585 00586 cwise_wrong__ = sqrt(dlamch_("Epsilon")); 00587 i__1 = *nrhs; 00588 for (j = 1; j <= i__1; ++j) { 00589 if (err_bnds_comp__[j + (err_bnds_comp_dim1 << 1)] < 00590 cwise_wrong__) { 00591 rcond_tmp__ = zla_syrcond_x__(uplo, n, &a[a_offset], lda, &af[ 00592 af_offset], ldaf, &ipiv[1], &x[j * x_dim1 + 1], info, 00593 &work[1], &rwork[1], (ftnlen)1); 00594 } else { 00595 rcond_tmp__ = 0.; 00596 } 00597 00598 /* Cap the error at 1.0. */ 00599 00600 if (*n_err_bnds__ >= 2 && err_bnds_comp__[j + (err_bnds_comp_dim1 00601 << 1)] > 1.) { 00602 err_bnds_comp__[j + (err_bnds_comp_dim1 << 1)] = 1.; 00603 } 00604 00605 /* Threshold the error (see LAWN). */ 00606 00607 if (rcond_tmp__ < illrcond_thresh__) { 00608 err_bnds_comp__[j + (err_bnds_comp_dim1 << 1)] = 1.; 00609 err_bnds_comp__[j + err_bnds_comp_dim1] = 0.; 00610 if (params[3] == 1. && *info < *n + j) { 00611 *info = *n + j; 00612 } 00613 } else if (err_bnds_comp__[j + (err_bnds_comp_dim1 << 1)] < 00614 err_lbnd__) { 00615 err_bnds_comp__[j + (err_bnds_comp_dim1 << 1)] = err_lbnd__; 00616 err_bnds_comp__[j + err_bnds_comp_dim1] = 1.; 00617 } 00618 00619 /* Save the condition number. */ 00620 00621 if (*n_err_bnds__ >= 3) { 00622 err_bnds_comp__[j + err_bnds_comp_dim1 * 3] = rcond_tmp__; 00623 } 00624 } 00625 } 00626 00627 return 0; 00628 00629 /* End of ZSYRFSX */ 00630 00631 } /* zsyrfsx_ */