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


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:14