Annotation of rpl/lapack/lapack/dla_gbrfsx_extended.f, revision 1.1
1.1 ! bertrand 1: SUBROUTINE DLA_GBRFSX_EXTENDED( PREC_TYPE, TRANS_TYPE, N, KL, KU,
! 2: $ NRHS, AB, LDAB, AFB, LDAFB, IPIV,
! 3: $ COLEQU, C, B, LDB, Y, LDY,
! 4: $ BERR_OUT, N_NORMS, ERR_BNDS_NORM,
! 5: $ ERR_BNDS_COMP, RES, AYB, DY,
! 6: $ Y_TAIL, RCOND, ITHRESH, RTHRESH,
! 7: $ DZ_UB, IGNORE_CWISE, INFO )
! 8: *
! 9: * -- LAPACK routine (version 3.2.1) --
! 10: * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and --
! 11: * -- Jason Riedy of Univ. of California Berkeley. --
! 12: * -- April 2009 --
! 13: *
! 14: * -- LAPACK is a software package provided by Univ. of Tennessee, --
! 15: * -- Univ. of California Berkeley and NAG Ltd. --
! 16: *
! 17: IMPLICIT NONE
! 18: * ..
! 19: * .. Scalar Arguments ..
! 20: INTEGER INFO, LDAB, LDAFB, LDB, LDY, N, KL, KU, NRHS,
! 21: $ PREC_TYPE, TRANS_TYPE, N_NORMS, ITHRESH
! 22: LOGICAL COLEQU, IGNORE_CWISE
! 23: DOUBLE PRECISION RTHRESH, DZ_UB
! 24: * ..
! 25: * .. Array Arguments ..
! 26: INTEGER IPIV( * )
! 27: DOUBLE PRECISION AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ),
! 28: $ Y( LDY, * ), RES(*), DY(*), Y_TAIL(*)
! 29: DOUBLE PRECISION C( * ), AYB(*), RCOND, BERR_OUT(*),
! 30: $ ERR_BNDS_NORM( NRHS, * ),
! 31: $ ERR_BNDS_COMP( NRHS, * )
! 32: * ..
! 33: *
! 34: * Purpose
! 35: * =======
! 36: *
! 37: * DLA_GBRFSX_EXTENDED improves the computed solution to a system of
! 38: * linear equations by performing extra-precise iterative refinement
! 39: * and provides error bounds and backward error estimates for the solution.
! 40: * This subroutine is called by DGBRFSX to perform iterative refinement.
! 41: * In addition to normwise error bound, the code provides maximum
! 42: * componentwise error bound if possible. See comments for ERR_BNDS_NORM
! 43: * and ERR_BNDS_COMP for details of the error bounds. Note that this
! 44: * subroutine is only resonsible for setting the second fields of
! 45: * ERR_BNDS_NORM and ERR_BNDS_COMP.
! 46: *
! 47: * Arguments
! 48: * =========
! 49: *
! 50: * PREC_TYPE (input) INTEGER
! 51: * Specifies the intermediate precision to be used in refinement.
! 52: * The value is defined by ILAPREC(P) where P is a CHARACTER and
! 53: * P = 'S': Single
! 54: * = 'D': Double
! 55: * = 'I': Indigenous
! 56: * = 'X', 'E': Extra
! 57: *
! 58: * TRANS_TYPE (input) INTEGER
! 59: * Specifies the transposition operation on A.
! 60: * The value is defined by ILATRANS(T) where T is a CHARACTER and
! 61: * T = 'N': No transpose
! 62: * = 'T': Transpose
! 63: * = 'C': Conjugate transpose
! 64: *
! 65: * N (input) INTEGER
! 66: * The number of linear equations, i.e., the order of the
! 67: * matrix A. N >= 0.
! 68: *
! 69: * KL (input) INTEGER
! 70: * The number of subdiagonals within the band of A. KL >= 0.
! 71: *
! 72: * KU (input) INTEGER
! 73: * The number of superdiagonals within the band of A. KU >= 0
! 74: *
! 75: * NRHS (input) INTEGER
! 76: * The number of right-hand-sides, i.e., the number of columns of the
! 77: * matrix B.
! 78: *
! 79: * A (input) DOUBLE PRECISION array, dimension (LDA,N)
! 80: * On entry, the N-by-N matrix A.
! 81: *
! 82: * LDA (input) INTEGER
! 83: * The leading dimension of the array A. LDA >= max(1,N).
! 84: *
! 85: * AF (input) DOUBLE PRECISION array, dimension (LDAF,N)
! 86: * The factors L and U from the factorization
! 87: * A = P*L*U as computed by DGBTRF.
! 88: *
! 89: * LDAF (input) INTEGER
! 90: * The leading dimension of the array AF. LDAF >= max(1,N).
! 91: *
! 92: * IPIV (input) INTEGER array, dimension (N)
! 93: * The pivot indices from the factorization A = P*L*U
! 94: * as computed by DGBTRF; row i of the matrix was interchanged
! 95: * with row IPIV(i).
! 96: *
! 97: * COLEQU (input) LOGICAL
! 98: * If .TRUE. then column equilibration was done to A before calling
! 99: * this routine. This is needed to compute the solution and error
! 100: * bounds correctly.
! 101: *
! 102: * C (input) DOUBLE PRECISION array, dimension (N)
! 103: * The column scale factors for A. If COLEQU = .FALSE., C
! 104: * is not accessed. If C is input, each element of C should be a power
! 105: * of the radix to ensure a reliable solution and error estimates.
! 106: * Scaling by powers of the radix does not cause rounding errors unless
! 107: * the result underflows or overflows. Rounding errors during scaling
! 108: * lead to refining with a matrix that is not equivalent to the
! 109: * input matrix, producing error estimates that may not be
! 110: * reliable.
! 111: *
! 112: * B (input) DOUBLE PRECISION array, dimension (LDB,NRHS)
! 113: * The right-hand-side matrix B.
! 114: *
! 115: * LDB (input) INTEGER
! 116: * The leading dimension of the array B. LDB >= max(1,N).
! 117: *
! 118: * Y (input/output) DOUBLE PRECISION array, dimension
! 119: * (LDY,NRHS)
! 120: * On entry, the solution matrix X, as computed by DGBTRS.
! 121: * On exit, the improved solution matrix Y.
! 122: *
! 123: * LDY (input) INTEGER
! 124: * The leading dimension of the array Y. LDY >= max(1,N).
! 125: *
! 126: * BERR_OUT (output) DOUBLE PRECISION array, dimension (NRHS)
! 127: * On exit, BERR_OUT(j) contains the componentwise relative backward
! 128: * error for right-hand-side j from the formula
! 129: * max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )
! 130: * where abs(Z) is the componentwise absolute value of the matrix
! 131: * or vector Z. This is computed by DLA_LIN_BERR.
! 132: *
! 133: * N_NORMS (input) INTEGER
! 134: * Determines which error bounds to return (see ERR_BNDS_NORM
! 135: * and ERR_BNDS_COMP).
! 136: * If N_NORMS >= 1 return normwise error bounds.
! 137: * If N_NORMS >= 2 return componentwise error bounds.
! 138: *
! 139: * ERR_BNDS_NORM (input/output) DOUBLE PRECISION array, dimension
! 140: * (NRHS, N_ERR_BNDS)
! 141: * For each right-hand side, this array contains information about
! 142: * various error bounds and condition numbers corresponding to the
! 143: * normwise relative error, which is defined as follows:
! 144: *
! 145: * Normwise relative error in the ith solution vector:
! 146: * max_j (abs(XTRUE(j,i) - X(j,i)))
! 147: * ------------------------------
! 148: * max_j abs(X(j,i))
! 149: *
! 150: * The array is indexed by the type of error information as described
! 151: * below. There currently are up to three pieces of information
! 152: * returned.
! 153: *
! 154: * The first index in ERR_BNDS_NORM(i,:) corresponds to the ith
! 155: * right-hand side.
! 156: *
! 157: * The second index in ERR_BNDS_NORM(:,err) contains the following
! 158: * three fields:
! 159: * err = 1 "Trust/don't trust" boolean. Trust the answer if the
! 160: * reciprocal condition number is less than the threshold
! 161: * sqrt(n) * slamch('Epsilon').
! 162: *
! 163: * err = 2 "Guaranteed" error bound: The estimated forward error,
! 164: * almost certainly within a factor of 10 of the true error
! 165: * so long as the next entry is greater than the threshold
! 166: * sqrt(n) * slamch('Epsilon'). This error bound should only
! 167: * be trusted if the previous boolean is true.
! 168: *
! 169: * err = 3 Reciprocal condition number: Estimated normwise
! 170: * reciprocal condition number. Compared with the threshold
! 171: * sqrt(n) * slamch('Epsilon') to determine if the error
! 172: * estimate is "guaranteed". These reciprocal condition
! 173: * numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some
! 174: * appropriately scaled matrix Z.
! 175: * Let Z = S*A, where S scales each row by a power of the
! 176: * radix so all absolute row sums of Z are approximately 1.
! 177: *
! 178: * This subroutine is only responsible for setting the second field
! 179: * above.
! 180: * See Lapack Working Note 165 for further details and extra
! 181: * cautions.
! 182: *
! 183: * ERR_BNDS_COMP (input/output) DOUBLE PRECISION array, dimension
! 184: * (NRHS, N_ERR_BNDS)
! 185: * For each right-hand side, this array contains information about
! 186: * various error bounds and condition numbers corresponding to the
! 187: * componentwise relative error, which is defined as follows:
! 188: *
! 189: * Componentwise relative error in the ith solution vector:
! 190: * abs(XTRUE(j,i) - X(j,i))
! 191: * max_j ----------------------
! 192: * abs(X(j,i))
! 193: *
! 194: * The array is indexed by the right-hand side i (on which the
! 195: * componentwise relative error depends), and the type of error
! 196: * information as described below. There currently are up to three
! 197: * pieces of information returned for each right-hand side. If
! 198: * componentwise accuracy is not requested (PARAMS(3) = 0.0), then
! 199: * ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most
! 200: * the first (:,N_ERR_BNDS) entries are returned.
! 201: *
! 202: * The first index in ERR_BNDS_COMP(i,:) corresponds to the ith
! 203: * right-hand side.
! 204: *
! 205: * The second index in ERR_BNDS_COMP(:,err) contains the following
! 206: * three fields:
! 207: * err = 1 "Trust/don't trust" boolean. Trust the answer if the
! 208: * reciprocal condition number is less than the threshold
! 209: * sqrt(n) * slamch('Epsilon').
! 210: *
! 211: * err = 2 "Guaranteed" error bound: The estimated forward error,
! 212: * almost certainly within a factor of 10 of the true error
! 213: * so long as the next entry is greater than the threshold
! 214: * sqrt(n) * slamch('Epsilon'). This error bound should only
! 215: * be trusted if the previous boolean is true.
! 216: *
! 217: * err = 3 Reciprocal condition number: Estimated componentwise
! 218: * reciprocal condition number. Compared with the threshold
! 219: * sqrt(n) * slamch('Epsilon') to determine if the error
! 220: * estimate is "guaranteed". These reciprocal condition
! 221: * numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some
! 222: * appropriately scaled matrix Z.
! 223: * Let Z = S*(A*diag(x)), where x is the solution for the
! 224: * current right-hand side and S scales each row of
! 225: * A*diag(x) by a power of the radix so all absolute row
! 226: * sums of Z are approximately 1.
! 227: *
! 228: * This subroutine is only responsible for setting the second field
! 229: * above.
! 230: * See Lapack Working Note 165 for further details and extra
! 231: * cautions.
! 232: *
! 233: * RES (input) DOUBLE PRECISION array, dimension (N)
! 234: * Workspace to hold the intermediate residual.
! 235: *
! 236: * AYB (input) DOUBLE PRECISION array, dimension (N)
! 237: * Workspace. This can be the same workspace passed for Y_TAIL.
! 238: *
! 239: * DY (input) DOUBLE PRECISION array, dimension (N)
! 240: * Workspace to hold the intermediate solution.
! 241: *
! 242: * Y_TAIL (input) DOUBLE PRECISION array, dimension (N)
! 243: * Workspace to hold the trailing bits of the intermediate solution.
! 244: *
! 245: * RCOND (input) DOUBLE PRECISION
! 246: * Reciprocal scaled condition number. This is an estimate of the
! 247: * reciprocal Skeel condition number of the matrix A after
! 248: * equilibration (if done). If this is less than the machine
! 249: * precision (in particular, if it is zero), the matrix is singular
! 250: * to working precision. Note that the error may still be small even
! 251: * if this number is very small and the matrix appears ill-
! 252: * conditioned.
! 253: *
! 254: * ITHRESH (input) INTEGER
! 255: * The maximum number of residual computations allowed for
! 256: * refinement. The default is 10. For 'aggressive' set to 100 to
! 257: * permit convergence using approximate factorizations or
! 258: * factorizations other than LU. If the factorization uses a
! 259: * technique other than Gaussian elimination, the guarantees in
! 260: * ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy.
! 261: *
! 262: * RTHRESH (input) DOUBLE PRECISION
! 263: * Determines when to stop refinement if the error estimate stops
! 264: * decreasing. Refinement will stop when the next solution no longer
! 265: * satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is
! 266: * the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The
! 267: * default value is 0.5. For 'aggressive' set to 0.9 to permit
! 268: * convergence on extremely ill-conditioned matrices. See LAWN 165
! 269: * for more details.
! 270: *
! 271: * DZ_UB (input) DOUBLE PRECISION
! 272: * Determines when to start considering componentwise convergence.
! 273: * Componentwise convergence is only considered after each component
! 274: * of the solution Y is stable, which we definte as the relative
! 275: * change in each component being less than DZ_UB. The default value
! 276: * is 0.25, requiring the first bit to be stable. See LAWN 165 for
! 277: * more details.
! 278: *
! 279: * IGNORE_CWISE (input) LOGICAL
! 280: * If .TRUE. then ignore componentwise convergence. Default value
! 281: * is .FALSE..
! 282: *
! 283: * INFO (output) INTEGER
! 284: * = 0: Successful exit.
! 285: * < 0: if INFO = -i, the ith argument to DGBTRS had an illegal
! 286: * value
! 287: *
! 288: * =====================================================================
! 289: *
! 290: * .. Local Scalars ..
! 291: CHARACTER TRANS
! 292: INTEGER CNT, I, J, M, X_STATE, Z_STATE, Y_PREC_STATE
! 293: DOUBLE PRECISION YK, DYK, YMIN, NORMY, NORMX, NORMDX, DXRAT,
! 294: $ DZRAT, PREVNORMDX, PREV_DZ_Z, DXRATMAX,
! 295: $ DZRATMAX, DX_X, DZ_Z, FINAL_DX_X, FINAL_DZ_Z,
! 296: $ EPS, HUGEVAL, INCR_THRESH
! 297: LOGICAL INCR_PREC
! 298: * ..
! 299: * .. Parameters ..
! 300: INTEGER UNSTABLE_STATE, WORKING_STATE, CONV_STATE,
! 301: $ NOPROG_STATE, BASE_RESIDUAL, EXTRA_RESIDUAL,
! 302: $ EXTRA_Y
! 303: PARAMETER ( UNSTABLE_STATE = 0, WORKING_STATE = 1,
! 304: $ CONV_STATE = 2, NOPROG_STATE = 3 )
! 305: PARAMETER ( BASE_RESIDUAL = 0, EXTRA_RESIDUAL = 1,
! 306: $ EXTRA_Y = 2 )
! 307: INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
! 308: INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
! 309: INTEGER CMP_ERR_I, PIV_GROWTH_I
! 310: PARAMETER ( FINAL_NRM_ERR_I = 1, FINAL_CMP_ERR_I = 2,
! 311: $ BERR_I = 3 )
! 312: PARAMETER ( RCOND_I = 4, NRM_RCOND_I = 5, NRM_ERR_I = 6 )
! 313: PARAMETER ( CMP_RCOND_I = 7, CMP_ERR_I = 8,
! 314: $ PIV_GROWTH_I = 9 )
! 315: INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
! 316: $ LA_LINRX_CWISE_I
! 317: PARAMETER ( LA_LINRX_ITREF_I = 1,
! 318: $ LA_LINRX_ITHRESH_I = 2 )
! 319: PARAMETER ( LA_LINRX_CWISE_I = 3 )
! 320: INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
! 321: $ LA_LINRX_RCOND_I
! 322: PARAMETER ( LA_LINRX_TRUST_I = 1, LA_LINRX_ERR_I = 2 )
! 323: PARAMETER ( LA_LINRX_RCOND_I = 3 )
! 324: * ..
! 325: * .. External Subroutines ..
! 326: EXTERNAL DAXPY, DCOPY, DGBTRS, DGBMV, BLAS_DGBMV_X,
! 327: $ BLAS_DGBMV2_X, DLA_GBAMV, DLA_WWADDW, DLAMCH,
! 328: $ CHLA_TRANSTYPE, DLA_LIN_BERR
! 329: DOUBLE PRECISION DLAMCH
! 330: CHARACTER CHLA_TRANSTYPE
! 331: * ..
! 332: * .. Intrinsic Functions ..
! 333: INTRINSIC ABS, MAX, MIN
! 334: * ..
! 335: * .. Executable Statements ..
! 336: *
! 337: IF (INFO.NE.0) RETURN
! 338: TRANS = CHLA_TRANSTYPE(TRANS_TYPE)
! 339: EPS = DLAMCH( 'Epsilon' )
! 340: HUGEVAL = DLAMCH( 'Overflow' )
! 341: * Force HUGEVAL to Inf
! 342: HUGEVAL = HUGEVAL * HUGEVAL
! 343: * Using HUGEVAL may lead to spurious underflows.
! 344: INCR_THRESH = DBLE( N ) * EPS
! 345: M = KL+KU+1
! 346:
! 347: DO J = 1, NRHS
! 348: Y_PREC_STATE = EXTRA_RESIDUAL
! 349: IF ( Y_PREC_STATE .EQ. EXTRA_Y ) THEN
! 350: DO I = 1, N
! 351: Y_TAIL( I ) = 0.0D+0
! 352: END DO
! 353: END IF
! 354:
! 355: DXRAT = 0.0D+0
! 356: DXRATMAX = 0.0D+0
! 357: DZRAT = 0.0D+0
! 358: DZRATMAX = 0.0D+0
! 359: FINAL_DX_X = HUGEVAL
! 360: FINAL_DZ_Z = HUGEVAL
! 361: PREVNORMDX = HUGEVAL
! 362: PREV_DZ_Z = HUGEVAL
! 363: DZ_Z = HUGEVAL
! 364: DX_X = HUGEVAL
! 365:
! 366: X_STATE = WORKING_STATE
! 367: Z_STATE = UNSTABLE_STATE
! 368: INCR_PREC = .FALSE.
! 369:
! 370: DO CNT = 1, ITHRESH
! 371: *
! 372: * Compute residual RES = B_s - op(A_s) * Y,
! 373: * op(A) = A, A**T, or A**H depending on TRANS (and type).
! 374: *
! 375: CALL DCOPY( N, B( 1, J ), 1, RES, 1 )
! 376: IF ( Y_PREC_STATE .EQ. BASE_RESIDUAL ) THEN
! 377: CALL DGBMV( TRANS, M, N, KL, KU, -1.0D+0, AB, LDAB,
! 378: $ Y( 1, J ), 1, 1.0D+0, RES, 1 )
! 379: ELSE IF ( Y_PREC_STATE .EQ. EXTRA_RESIDUAL ) THEN
! 380: CALL BLAS_DGBMV_X( TRANS_TYPE, N, N, KL, KU,
! 381: $ -1.0D+0, AB, LDAB, Y( 1, J ), 1, 1.0D+0, RES, 1,
! 382: $ PREC_TYPE )
! 383: ELSE
! 384: CALL BLAS_DGBMV2_X( TRANS_TYPE, N, N, KL, KU, -1.0D+0,
! 385: $ AB, LDAB, Y( 1, J ), Y_TAIL, 1, 1.0D+0, RES, 1,
! 386: $ PREC_TYPE )
! 387: END IF
! 388:
! 389: ! XXX: RES is no longer needed.
! 390: CALL DCOPY( N, RES, 1, DY, 1 )
! 391: CALL DGBTRS( TRANS, N, KL, KU, 1, AFB, LDAFB, IPIV, DY, N,
! 392: $ INFO )
! 393: *
! 394: * Calculate relative changes DX_X, DZ_Z and ratios DXRAT, DZRAT.
! 395: *
! 396: NORMX = 0.0D+0
! 397: NORMY = 0.0D+0
! 398: NORMDX = 0.0D+0
! 399: DZ_Z = 0.0D+0
! 400: YMIN = HUGEVAL
! 401:
! 402: DO I = 1, N
! 403: YK = ABS( Y( I, J ) )
! 404: DYK = ABS( DY( I ) )
! 405:
! 406: IF ( YK .NE. 0.0D+0 ) THEN
! 407: DZ_Z = MAX( DZ_Z, DYK / YK )
! 408: ELSE IF ( DYK .NE. 0.0D+0 ) THEN
! 409: DZ_Z = HUGEVAL
! 410: END IF
! 411:
! 412: YMIN = MIN( YMIN, YK )
! 413:
! 414: NORMY = MAX( NORMY, YK )
! 415:
! 416: IF ( COLEQU ) THEN
! 417: NORMX = MAX( NORMX, YK * C( I ) )
! 418: NORMDX = MAX( NORMDX, DYK * C( I ) )
! 419: ELSE
! 420: NORMX = NORMY
! 421: NORMDX = MAX( NORMDX, DYK )
! 422: END IF
! 423: END DO
! 424:
! 425: IF ( NORMX .NE. 0.0D+0 ) THEN
! 426: DX_X = NORMDX / NORMX
! 427: ELSE IF ( NORMDX .EQ. 0.0D+0 ) THEN
! 428: DX_X = 0.0D+0
! 429: ELSE
! 430: DX_X = HUGEVAL
! 431: END IF
! 432:
! 433: DXRAT = NORMDX / PREVNORMDX
! 434: DZRAT = DZ_Z / PREV_DZ_Z
! 435: *
! 436: * Check termination criteria.
! 437: *
! 438: IF ( .NOT.IGNORE_CWISE
! 439: $ .AND. YMIN*RCOND .LT. INCR_THRESH*NORMY
! 440: $ .AND. Y_PREC_STATE .LT. EXTRA_Y )
! 441: $ INCR_PREC = .TRUE.
! 442:
! 443: IF ( X_STATE .EQ. NOPROG_STATE .AND. DXRAT .LE. RTHRESH )
! 444: $ X_STATE = WORKING_STATE
! 445: IF ( X_STATE .EQ. WORKING_STATE ) THEN
! 446: IF ( DX_X .LE. EPS ) THEN
! 447: X_STATE = CONV_STATE
! 448: ELSE IF ( DXRAT .GT. RTHRESH ) THEN
! 449: IF ( Y_PREC_STATE .NE. EXTRA_Y ) THEN
! 450: INCR_PREC = .TRUE.
! 451: ELSE
! 452: X_STATE = NOPROG_STATE
! 453: END IF
! 454: ELSE
! 455: IF ( DXRAT .GT. DXRATMAX ) DXRATMAX = DXRAT
! 456: END IF
! 457: IF ( X_STATE .GT. WORKING_STATE ) FINAL_DX_X = DX_X
! 458: END IF
! 459:
! 460: IF ( Z_STATE .EQ. UNSTABLE_STATE .AND. DZ_Z .LE. DZ_UB )
! 461: $ Z_STATE = WORKING_STATE
! 462: IF ( Z_STATE .EQ. NOPROG_STATE .AND. DZRAT .LE. RTHRESH )
! 463: $ Z_STATE = WORKING_STATE
! 464: IF ( Z_STATE .EQ. WORKING_STATE ) THEN
! 465: IF ( DZ_Z .LE. EPS ) THEN
! 466: Z_STATE = CONV_STATE
! 467: ELSE IF ( DZ_Z .GT. DZ_UB ) THEN
! 468: Z_STATE = UNSTABLE_STATE
! 469: DZRATMAX = 0.0D+0
! 470: FINAL_DZ_Z = HUGEVAL
! 471: ELSE IF ( DZRAT .GT. RTHRESH ) THEN
! 472: IF ( Y_PREC_STATE .NE. EXTRA_Y ) THEN
! 473: INCR_PREC = .TRUE.
! 474: ELSE
! 475: Z_STATE = NOPROG_STATE
! 476: END IF
! 477: ELSE
! 478: IF ( DZRAT .GT. DZRATMAX ) DZRATMAX = DZRAT
! 479: END IF
! 480: IF ( Z_STATE .GT. WORKING_STATE ) FINAL_DZ_Z = DZ_Z
! 481: END IF
! 482: *
! 483: * Exit if both normwise and componentwise stopped working,
! 484: * but if componentwise is unstable, let it go at least two
! 485: * iterations.
! 486: *
! 487: IF ( X_STATE.NE.WORKING_STATE ) THEN
! 488: IF ( IGNORE_CWISE ) GOTO 666
! 489: IF ( Z_STATE.EQ.NOPROG_STATE .OR. Z_STATE.EQ.CONV_STATE )
! 490: $ GOTO 666
! 491: IF ( Z_STATE.EQ.UNSTABLE_STATE .AND. CNT.GT.1 ) GOTO 666
! 492: END IF
! 493:
! 494: IF ( INCR_PREC ) THEN
! 495: INCR_PREC = .FALSE.
! 496: Y_PREC_STATE = Y_PREC_STATE + 1
! 497: DO I = 1, N
! 498: Y_TAIL( I ) = 0.0D+0
! 499: END DO
! 500: END IF
! 501:
! 502: PREVNORMDX = NORMDX
! 503: PREV_DZ_Z = DZ_Z
! 504: *
! 505: * Update soluton.
! 506: *
! 507: IF (Y_PREC_STATE .LT. EXTRA_Y) THEN
! 508: CALL DAXPY( N, 1.0D+0, DY, 1, Y(1,J), 1 )
! 509: ELSE
! 510: CALL DLA_WWADDW( N, Y(1,J), Y_TAIL, DY )
! 511: END IF
! 512:
! 513: END DO
! 514: * Target of "IF (Z_STOP .AND. X_STOP)". Sun's f77 won't EXIT.
! 515: 666 CONTINUE
! 516: *
! 517: * Set final_* when cnt hits ithresh.
! 518: *
! 519: IF ( X_STATE .EQ. WORKING_STATE ) FINAL_DX_X = DX_X
! 520: IF ( Z_STATE .EQ. WORKING_STATE ) FINAL_DZ_Z = DZ_Z
! 521: *
! 522: * Compute error bounds.
! 523: *
! 524: IF ( N_NORMS .GE. 1 ) THEN
! 525: ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) =
! 526: $ FINAL_DX_X / (1 - DXRATMAX)
! 527: END IF
! 528: IF (N_NORMS .GE. 2) THEN
! 529: ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) =
! 530: $ FINAL_DZ_Z / (1 - DZRATMAX)
! 531: END IF
! 532: *
! 533: * Compute componentwise relative backward error from formula
! 534: * max(i) ( abs(R(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )
! 535: * where abs(Z) is the componentwise absolute value of the matrix
! 536: * or vector Z.
! 537: *
! 538: * Compute residual RES = B_s - op(A_s) * Y,
! 539: * op(A) = A, A**T, or A**H depending on TRANS (and type).
! 540: *
! 541: CALL DCOPY( N, B( 1, J ), 1, RES, 1 )
! 542: CALL DGBMV(TRANS, N, N, KL, KU, -1.0D+0, AB, LDAB, Y(1,J),
! 543: $ 1, 1.0D+0, RES, 1 )
! 544:
! 545: DO I = 1, N
! 546: AYB( I ) = ABS( B( I, J ) )
! 547: END DO
! 548: *
! 549: * Compute abs(op(A_s))*abs(Y) + abs(B_s).
! 550: *
! 551: CALL DLA_GBAMV( TRANS_TYPE, N, N, KL, KU, 1.0D+0,
! 552: $ AB, LDAB, Y(1, J), 1, 1.0D+0, AYB, 1 )
! 553:
! 554: CALL DLA_LIN_BERR( N, N, 1, RES, AYB, BERR_OUT( J ) )
! 555: *
! 556: * End of loop for each RHS
! 557: *
! 558: END DO
! 559: *
! 560: RETURN
! 561: END
CVSweb interface <joel.bertrand@systella.fr>