LAPACK 3.3.1
Linear Algebra PACKage

dla_syrfsx_extended.f

Go to the documentation of this file.
00001       SUBROUTINE DLA_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       DOUBLE PRECISION   RTHRESH, DZ_UB
00025 *     ..
00026 *     .. Array Arguments ..
00027       INTEGER            IPIV( * )
00028       DOUBLE PRECISION   A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
00029      $                   Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * )
00030       DOUBLE PRECISION   C( * ), AYB( * ), RCOND, BERR_OUT( * ),
00031      $                   ERR_BNDS_NORM( NRHS, * ),
00032      $                   ERR_BNDS_COMP( NRHS, * )
00033 *     ..
00034 *
00035 *  Purpose
00036 *  =======
00037 * 
00038 *  DLA_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 DSYRFSX 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) DOUBLE PRECISION 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) DOUBLE PRECISION 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 DSYTRF.
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 DSYTRF.
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) DOUBLE PRECISION 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) DOUBLE PRECISION 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) DOUBLE PRECISION array, dimension
00110 *                    (LDY,NRHS)
00111 *     On entry, the solution matrix X, as computed by DSYTRS.
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) DOUBLE PRECISION 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 DLA_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) DOUBLE PRECISION 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) DOUBLE PRECISION 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) DOUBLE PRECISION array, dimension (N)
00225 *     Workspace to hold the intermediate residual.
00226 *
00227 *     AYB            (input) DOUBLE PRECISION array, dimension (N)
00228 *     Workspace. This can be the same workspace passed for Y_TAIL.
00229 *
00230 *     DY             (input) DOUBLE PRECISION array, dimension (N)
00231 *     Workspace to hold the intermediate solution.
00232 *
00233 *     Y_TAIL         (input) DOUBLE PRECISION array, dimension (N)
00234 *     Workspace to hold the trailing bits of the intermediate solution.
00235 *
00236 *     RCOND          (input) DOUBLE PRECISION
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) DOUBLE PRECISION
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) DOUBLE PRECISION
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 DSYTRS had an illegal
00277 *             value
00278 *
00279 *  =====================================================================
00280 *
00281 *     .. Local Scalars ..
00282       INTEGER            UPLO2, CNT, I, J, X_STATE, Z_STATE
00283       DOUBLE PRECISION   YK, DYK, YMIN, NORMY, NORMX, NORMDX, DXRAT,
00284      $                   DZRAT, PREVNORMDX, PREV_DZ_Z, DXRATMAX,
00285      $                   DZRATMAX, DX_X, DZ_Z, FINAL_DX_X, FINAL_DZ_Z,
00286      $                   EPS, HUGEVAL, INCR_THRESH
00287       LOGICAL            INCR_PREC
00288 *     ..
00289 *     .. Parameters ..
00290       INTEGER            UNSTABLE_STATE, WORKING_STATE, CONV_STATE,
00291      $                   NOPROG_STATE, Y_PREC_STATE, BASE_RESIDUAL,
00292      $                   EXTRA_RESIDUAL, EXTRA_Y
00293       PARAMETER          ( UNSTABLE_STATE = 0, WORKING_STATE = 1,
00294      $                   CONV_STATE = 2, NOPROG_STATE = 3 )
00295       PARAMETER          ( BASE_RESIDUAL = 0, EXTRA_RESIDUAL = 1,
00296      $                   EXTRA_Y = 2 )
00297       INTEGER            FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
00298       INTEGER            RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
00299       INTEGER            CMP_ERR_I, PIV_GROWTH_I
00300       PARAMETER          ( FINAL_NRM_ERR_I = 1, FINAL_CMP_ERR_I = 2,
00301      $                   BERR_I = 3 )
00302       PARAMETER          ( RCOND_I = 4, NRM_RCOND_I = 5, NRM_ERR_I = 6 )
00303       PARAMETER          ( CMP_RCOND_I = 7, CMP_ERR_I = 8,
00304      $                   PIV_GROWTH_I = 9 )
00305       INTEGER            LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
00306      $                   LA_LINRX_CWISE_I
00307       PARAMETER          ( LA_LINRX_ITREF_I = 1,
00308      $                   LA_LINRX_ITHRESH_I = 2 )
00309       PARAMETER          ( LA_LINRX_CWISE_I = 3 )
00310       INTEGER            LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
00311      $                   LA_LINRX_RCOND_I
00312       PARAMETER          ( LA_LINRX_TRUST_I = 1, LA_LINRX_ERR_I = 2 )
00313       PARAMETER          ( LA_LINRX_RCOND_I = 3 )
00314 *     ..
00315 *     .. External Functions ..
00316       LOGICAL            LSAME
00317       EXTERNAL           ILAUPLO
00318       INTEGER            ILAUPLO
00319 *     ..
00320 *     .. External Subroutines ..
00321       EXTERNAL           DAXPY, DCOPY, DSYTRS, DSYMV, BLAS_DSYMV_X,
00322      $                   BLAS_DSYMV2_X, DLA_SYAMV, DLA_WWADDW,
00323      $                   DLA_LIN_BERR
00324       DOUBLE PRECISION   DLAMCH
00325 *     ..
00326 *     .. Intrinsic Functions ..
00327       INTRINSIC          ABS, MAX, MIN
00328 *     ..
00329 *     .. Executable Statements ..
00330 *
00331       IF ( INFO.NE.0 ) RETURN
00332       EPS = DLAMCH( 'Epsilon' )
00333       HUGEVAL = DLAMCH( 'Overflow' )
00334 *     Force HUGEVAL to Inf
00335       HUGEVAL = HUGEVAL * HUGEVAL
00336 *     Using HUGEVAL may lead to spurious underflows.
00337       INCR_THRESH = DBLE( N )*EPS
00338 
00339       IF ( LSAME ( UPLO, 'L' ) ) THEN
00340          UPLO2 = ILAUPLO( 'L' )
00341       ELSE
00342          UPLO2 = ILAUPLO( 'U' )
00343       ENDIF
00344 
00345       DO J = 1, NRHS
00346          Y_PREC_STATE = EXTRA_RESIDUAL
00347          IF ( Y_PREC_STATE .EQ. EXTRA_Y ) THEN
00348             DO I = 1, N
00349                Y_TAIL( I ) = 0.0D+0
00350             END DO
00351          END IF
00352 
00353          DXRAT = 0.0D+0
00354          DXRATMAX = 0.0D+0
00355          DZRAT = 0.0D+0
00356          DZRATMAX = 0.0D+0
00357          FINAL_DX_X = HUGEVAL
00358          FINAL_DZ_Z = HUGEVAL
00359          PREVNORMDX = HUGEVAL
00360          PREV_DZ_Z = HUGEVAL
00361          DZ_Z = HUGEVAL
00362          DX_X = HUGEVAL
00363 
00364          X_STATE = WORKING_STATE
00365          Z_STATE = UNSTABLE_STATE
00366          INCR_PREC = .FALSE.
00367 
00368          DO CNT = 1, ITHRESH
00369 *
00370 *        Compute residual RES = B_s - op(A_s) * Y,
00371 *            op(A) = A, A**T, or A**H depending on TRANS (and type).
00372 *
00373             CALL DCOPY( N, B( 1, J ), 1, RES, 1 )
00374             IF (Y_PREC_STATE .EQ. BASE_RESIDUAL) THEN
00375                CALL DSYMV( UPLO, N, -1.0D+0, A, LDA, Y(1,J), 1,
00376      $              1.0D+0, RES, 1 )
00377             ELSE IF (Y_PREC_STATE .EQ. EXTRA_RESIDUAL) THEN
00378                CALL BLAS_DSYMV_X( UPLO2, N, -1.0D+0, A, LDA,
00379      $              Y( 1, J ), 1, 1.0D+0, RES, 1, PREC_TYPE )
00380             ELSE
00381                CALL BLAS_DSYMV2_X(UPLO2, N, -1.0D+0, A, LDA,
00382      $              Y(1, J), Y_TAIL, 1, 1.0D+0, RES, 1, PREC_TYPE)
00383             END IF
00384             
00385 !         XXX: RES is no longer needed.
00386             CALL DCOPY( N, RES, 1, DY, 1 )
00387             CALL DSYTRS( UPLO, N, 1, AF, LDAF, IPIV, DY, N, INFO )
00388 *
00389 *         Calculate relative changes DX_X, DZ_Z and ratios DXRAT, DZRAT.
00390 *
00391             NORMX = 0.0D+0
00392             NORMY = 0.0D+0
00393             NORMDX = 0.0D+0
00394             DZ_Z = 0.0D+0
00395             YMIN = HUGEVAL
00396             
00397             DO I = 1, N
00398                YK = ABS( Y( I, J ) )
00399                DYK = ABS( DY( I ) )
00400                
00401                IF ( YK .NE. 0.0D+0 ) THEN
00402                   DZ_Z = MAX( DZ_Z, DYK / YK )
00403                ELSE IF ( DYK .NE. 0.0D+0 ) THEN
00404                   DZ_Z = HUGEVAL
00405                END IF
00406 
00407                YMIN = MIN( YMIN, YK )
00408 
00409                NORMY = MAX( NORMY, YK )
00410 
00411                IF ( COLEQU ) THEN
00412                   NORMX = MAX( NORMX, YK * C( I ) )
00413                   NORMDX = MAX( NORMDX, DYK * C( I ) )
00414                ELSE
00415                   NORMX = NORMY
00416                   NORMDX = MAX(NORMDX, DYK)
00417                END IF
00418             END DO
00419 
00420             IF ( NORMX .NE. 0.0D+0 ) THEN
00421                DX_X = NORMDX / NORMX
00422             ELSE IF ( NORMDX .EQ. 0.0D+0 ) THEN
00423                DX_X = 0.0D+0
00424             ELSE
00425                DX_X = HUGEVAL
00426             END IF
00427 
00428             DXRAT = NORMDX / PREVNORMDX
00429             DZRAT = DZ_Z / PREV_DZ_Z
00430 *
00431 *         Check termination criteria.
00432 *
00433             IF ( YMIN*RCOND .LT. INCR_THRESH*NORMY
00434      $           .AND. Y_PREC_STATE .LT. EXTRA_Y )
00435      $           INCR_PREC = .TRUE.
00436 
00437             IF ( X_STATE .EQ. NOPROG_STATE .AND. DXRAT .LE. RTHRESH )
00438      $           X_STATE = WORKING_STATE
00439             IF ( X_STATE .EQ. WORKING_STATE ) THEN
00440                IF ( DX_X .LE. EPS ) THEN
00441                   X_STATE = CONV_STATE
00442                ELSE IF ( DXRAT .GT. RTHRESH ) THEN
00443                   IF ( Y_PREC_STATE .NE. EXTRA_Y ) THEN
00444                      INCR_PREC = .TRUE.
00445                   ELSE
00446                      X_STATE = NOPROG_STATE
00447                   END IF
00448                ELSE
00449                   IF ( DXRAT .GT. DXRATMAX ) DXRATMAX = DXRAT
00450                END IF
00451                IF ( X_STATE .GT. WORKING_STATE ) FINAL_DX_X = DX_X
00452             END IF
00453 
00454             IF ( Z_STATE .EQ. UNSTABLE_STATE .AND. DZ_Z .LE. DZ_UB )
00455      $           Z_STATE = WORKING_STATE
00456             IF ( Z_STATE .EQ. NOPROG_STATE .AND. DZRAT .LE. RTHRESH )
00457      $           Z_STATE = WORKING_STATE
00458             IF ( Z_STATE .EQ. WORKING_STATE ) THEN
00459                IF ( DZ_Z .LE. EPS ) THEN
00460                   Z_STATE = CONV_STATE
00461                ELSE IF ( DZ_Z .GT. DZ_UB ) THEN
00462                   Z_STATE = UNSTABLE_STATE
00463                   DZRATMAX = 0.0D+0
00464                   FINAL_DZ_Z = HUGEVAL
00465                ELSE IF ( DZRAT .GT. RTHRESH ) THEN
00466                   IF ( Y_PREC_STATE .NE. EXTRA_Y ) THEN
00467                      INCR_PREC = .TRUE.
00468                   ELSE
00469                      Z_STATE = NOPROG_STATE
00470                   END IF
00471                ELSE
00472                   IF ( DZRAT .GT. DZRATMAX ) DZRATMAX = DZRAT
00473                END IF
00474                IF ( Z_STATE .GT. WORKING_STATE ) FINAL_DZ_Z = DZ_Z
00475             END IF
00476 
00477             IF ( X_STATE.NE.WORKING_STATE.AND.
00478      $           ( IGNORE_CWISE.OR.Z_STATE.NE.WORKING_STATE ) )
00479      $           GOTO 666
00480 
00481             IF ( INCR_PREC ) THEN
00482                INCR_PREC = .FALSE.
00483                Y_PREC_STATE = Y_PREC_STATE + 1
00484                DO I = 1, N
00485                   Y_TAIL( I ) = 0.0D+0
00486                END DO
00487             END IF
00488 
00489             PREVNORMDX = NORMDX
00490             PREV_DZ_Z = DZ_Z
00491 *
00492 *           Update soluton.
00493 *
00494             IF (Y_PREC_STATE .LT. EXTRA_Y) THEN
00495                CALL DAXPY( N, 1.0D+0, DY, 1, Y(1,J), 1 )
00496             ELSE
00497                CALL DLA_WWADDW( N, Y(1,J), Y_TAIL, DY )
00498             END IF
00499             
00500          END DO
00501 *        Target of "IF (Z_STOP .AND. X_STOP)".  Sun's f77 won't EXIT.
00502  666     CONTINUE
00503 *
00504 *     Set final_* when cnt hits ithresh.
00505 *
00506          IF ( X_STATE .EQ. WORKING_STATE ) FINAL_DX_X = DX_X
00507          IF ( Z_STATE .EQ. WORKING_STATE ) FINAL_DZ_Z = DZ_Z
00508 *
00509 *     Compute error bounds.
00510 *
00511          IF ( N_NORMS .GE. 1 ) THEN
00512             ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) =
00513      $           FINAL_DX_X / (1 - DXRATMAX)
00514          END IF
00515          IF ( N_NORMS .GE. 2 ) THEN
00516             ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) =
00517      $           FINAL_DZ_Z / (1 - DZRATMAX)
00518          END IF
00519 *
00520 *     Compute componentwise relative backward error from formula
00521 *         max(i) ( abs(R(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )
00522 *     where abs(Z) is the componentwise absolute value of the matrix
00523 *     or vector Z.
00524 *
00525 *        Compute residual RES = B_s - op(A_s) * Y,
00526 *            op(A) = A, A**T, or A**H depending on TRANS (and type).
00527          CALL DCOPY( N, B( 1, J ), 1, RES, 1 )
00528          CALL DSYMV( UPLO, N, -1.0D+0, A, LDA, Y(1,J), 1, 1.0D+0, RES, 
00529      $     1 )
00530          
00531          DO I = 1, N
00532             AYB( I ) = ABS( B( I, J ) )
00533          END DO
00534 *
00535 *     Compute abs(op(A_s))*abs(Y) + abs(B_s).
00536 *
00537          CALL DLA_SYAMV( UPLO2, N, 1.0D+0,
00538      $        A, LDA, Y(1, J), 1, 1.0D+0, AYB, 1 )
00539          
00540          CALL DLA_LIN_BERR( N, N, 1, RES, AYB, BERR_OUT( J ) )
00541 *
00542 *     End of loop for each RHS.
00543 *
00544       END DO
00545 *
00546       RETURN
00547       END
 All Files Functions