404 $ NRHS, AB, LDAB, AFB, LDAFB, IPIV,
405 $ COLEQU, C, B, LDB, Y, LDY,
406 $ BERR_OUT, N_NORMS, ERR_BNDS_NORM,
407 $ ERR_BNDS_COMP, RES, AYB, DY,
408 $ Y_TAIL, RCOND, ITHRESH, RTHRESH,
409 $ DZ_UB, IGNORE_CWISE, INFO )
416 INTEGER INFO, LDAB, LDAFB, LDB, LDY, N, KL, KU, NRHS,
417 $ PREC_TYPE, TRANS_TYPE, N_NORMS, ITHRESH
418 LOGICAL COLEQU, IGNORE_CWISE
423 REAL AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ),
424 $ y( ldy, * ), res(*), dy(*), y_tail(*)
425 REAL C( * ), AYB(*), RCOND, BERR_OUT(*),
426 $ ERR_BNDS_NORM( NRHS, * ),
427 $ ERR_BNDS_COMP( NRHS, * )
434 INTEGER CNT, I, J, M, X_STATE, Z_STATE, Y_PREC_STATE
435 REAL YK, DYK, YMIN, NORMY, NORMX, NORMDX, DXRAT,
436 $ DZRAT, PREVNORMDX, PREV_DZ_Z, DXRATMAX,
437 $ DZRATMAX, DX_X, DZ_Z, FINAL_DX_X, FINAL_DZ_Z,
438 $ EPS, HUGEVAL, INCR_THRESH
442 INTEGER UNSTABLE_STATE, WORKING_STATE, CONV_STATE,
443 $ NOPROG_STATE, BASE_RESIDUAL, EXTRA_RESIDUAL,
445 parameter( unstable_state = 0, working_state = 1,
446 $ conv_state = 2, noprog_state = 3 )
447 parameter( base_residual = 0, extra_residual = 1,
449 INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
450 INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
451 INTEGER CMP_ERR_I, PIV_GROWTH_I
452 PARAMETER ( FINAL_NRM_ERR_I = 1, final_cmp_err_i = 2,
454 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
455 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
457 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
459 parameter( la_linrx_itref_i = 1,
460 $ la_linrx_ithresh_i = 2 )
461 parameter( la_linrx_cwise_i = 3 )
462 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
464 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
465 parameter( la_linrx_rcond_i = 3 )
472 CHARACTER CHLA_TRANSTYPE
475 INTRINSIC abs, max, min
479 IF (info.NE.0)
RETURN
480 trans = chla_transtype(trans_type)
481 eps = slamch(
'Epsilon' )
482 hugeval = slamch(
'Overflow' )
484 hugeval = hugeval * hugeval
486 incr_thresh = real( n ) * eps
490 y_prec_state = extra_residual
491 IF ( y_prec_state .EQ. extra_y )
THEN
508 x_state = working_state
509 z_state = unstable_state
517 CALL scopy( n, b( 1, j ), 1, res, 1 )
518 IF ( y_prec_state .EQ. base_residual )
THEN
519 CALL sgbmv( trans, m, n, kl, ku, -1.0, ab, ldab,
520 $ y( 1, j ), 1, 1.0, res, 1 )
521 ELSE IF ( y_prec_state .EQ. extra_residual )
THEN
522 CALL blas_sgbmv_x( trans_type, n, n, kl, ku,
523 $ -1.0, ab, ldab, y( 1, j ), 1, 1.0, res, 1,
526 CALL blas_sgbmv2_x( trans_type, n, n, kl, ku, -1.0,
527 $ ab, ldab, y( 1, j ), y_tail, 1, 1.0, res, 1,
532 CALL scopy( n, res, 1, dy, 1 )
533 CALL sgbtrs( trans, n, kl, ku, 1, afb, ldafb, ipiv, dy, n,
545 yk = abs( y( i, j ) )
548 IF ( yk .NE. 0.0 )
THEN
549 dz_z = max( dz_z, dyk / yk )
550 ELSE IF ( dyk .NE. 0.0 )
THEN
554 ymin = min( ymin, yk )
556 normy = max( normy, yk )
559 normx = max( normx, yk * c( i ) )
560 normdx = max( normdx, dyk * c( i ) )
563 normdx = max( normdx, dyk )
567 IF ( normx .NE. 0.0 )
THEN
568 dx_x = normdx / normx
569 ELSE IF ( normdx .EQ. 0.0 )
THEN
575 dxrat = normdx / prevnormdx
576 dzrat = dz_z / prev_dz_z
580 IF ( .NOT.ignore_cwise
581 $ .AND. ymin*rcond .LT. incr_thresh*normy
582 $ .AND. y_prec_state .LT. extra_y )
585 IF ( x_state .EQ. noprog_state .AND. dxrat .LE. rthresh )
586 $ x_state = working_state
587 IF ( x_state .EQ. working_state )
THEN
588 IF ( dx_x .LE. eps )
THEN
590 ELSE IF ( dxrat .GT. rthresh )
THEN
591 IF ( y_prec_state .NE. extra_y )
THEN
594 x_state = noprog_state
597 IF ( dxrat .GT. dxratmax ) dxratmax = dxrat
599 IF ( x_state .GT. working_state ) final_dx_x = dx_x
602 IF ( z_state .EQ. unstable_state .AND. dz_z .LE. dz_ub )
603 $ z_state = working_state
604 IF ( z_state .EQ. noprog_state .AND. dzrat .LE. rthresh )
605 $ z_state = working_state
606 IF ( z_state .EQ. working_state )
THEN
607 IF ( dz_z .LE. eps )
THEN
609 ELSE IF ( dz_z .GT. dz_ub )
THEN
610 z_state = unstable_state
613 ELSE IF ( dzrat .GT. rthresh )
THEN
614 IF ( y_prec_state .NE. extra_y )
THEN
617 z_state = noprog_state
620 IF ( dzrat .GT. dzratmax ) dzratmax = dzrat
622 IF ( z_state .GT. working_state ) final_dz_z = dz_z
629 IF ( x_state.NE.working_state )
THEN
630 IF ( ignore_cwise )
GOTO 666
631 IF ( z_state.EQ.noprog_state .OR. z_state.EQ.conv_state )
633 IF ( z_state.EQ.unstable_state .AND. cnt.GT.1 )
GOTO 666
636 IF ( incr_prec )
THEN
638 y_prec_state = y_prec_state + 1
649 IF (y_prec_state .LT. extra_y)
THEN
650 CALL saxpy( n, 1.0, dy, 1, y(1,j), 1 )
661 IF ( x_state .EQ. working_state ) final_dx_x = dx_x
662 IF ( z_state .EQ. working_state ) final_dz_z = dz_z
666 IF ( n_norms .GE. 1 )
THEN
667 err_bnds_norm( j, la_linrx_err_i ) =
668 $ final_dx_x / (1 - dxratmax)
670 IF (n_norms .GE. 2)
THEN
671 err_bnds_comp( j, la_linrx_err_i ) =
672 $ final_dz_z / (1 - dzratmax)
683 CALL scopy( n, b( 1, j ), 1, res, 1 )
684 CALL sgbmv(trans, n, n, kl, ku, -1.0, ab, ldab, y(1,j),
688 ayb( i ) = abs( b( i, j ) )
693 CALL sla_gbamv( trans_type, n, n, kl, ku, 1.0,
694 $ ab, ldab, y(1, j), 1, 1.0, ayb, 1 )
subroutine saxpy(n, sa, sx, incx, sy, incy)
SAXPY
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine sgbmv(trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy)
SGBMV
subroutine sgbtrs(trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info)
SGBTRS
subroutine sla_gbamv(trans, m, n, kl, ku, alpha, ab, ldab, x, incx, beta, y, incy)
SLA_GBAMV performs a matrix-vector operation to calculate error bounds.
subroutine sla_gbrfsx_extended(prec_type, trans_type, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, colequ, c, b, ldb, y, ldy, berr_out, n_norms, err_bnds_norm, err_bnds_comp, res, ayb, dy, y_tail, rcond, ithresh, rthresh, dz_ub, ignore_cwise, info)
SLA_GBRFSX_EXTENDED improves the computed solution to a system of linear equations for general banded...
subroutine sla_lin_berr(n, nz, nrhs, res, ayb, berr)
SLA_LIN_BERR computes a component-wise relative backward error.
character *1 function chla_transtype(trans)
CHLA_TRANSTYPE
subroutine sla_wwaddw(n, x, y, w)
SLA_WWADDW adds a vector into a doubled-single vector.
real function slamch(cmach)
SLAMCH