405 $ NRHS, AB, LDAB, AFB, LDAFB, IPIV,
406 $ COLEQU, C, B, LDB, Y, LDY,
407 $ BERR_OUT, N_NORMS, ERR_BNDS_NORM,
408 $ ERR_BNDS_COMP, RES, AYB, DY,
409 $ Y_TAIL, RCOND, ITHRESH, RTHRESH,
410 $ DZ_UB, IGNORE_CWISE, INFO )
417 INTEGER INFO, LDAB, LDAFB, LDB, LDY, N, KL, KU, NRHS,
418 $ PREC_TYPE, TRANS_TYPE, N_NORMS, ITHRESH
419 LOGICAL COLEQU, IGNORE_CWISE
420 DOUBLE PRECISION RTHRESH, DZ_UB
424 DOUBLE PRECISION AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ),
425 $ y( ldy, * ), res(*), dy(*), y_tail(*)
426 DOUBLE PRECISION C( * ), AYB(*), RCOND, BERR_OUT(*),
427 $ ERR_BNDS_NORM( NRHS, * ),
428 $ ERR_BNDS_COMP( NRHS, * )
435 INTEGER CNT, I, J, M, X_STATE, Z_STATE, Y_PREC_STATE
436 DOUBLE PRECISION YK, DYK, YMIN, NORMY, NORMX, NORMDX, DXRAT,
437 $ DZRAT, PREVNORMDX, PREV_DZ_Z, DXRATMAX,
438 $ DZRATMAX, DX_X, DZ_Z, FINAL_DX_X, FINAL_DZ_Z,
439 $ EPS, HUGEVAL, INCR_THRESH
443 INTEGER UNSTABLE_STATE, WORKING_STATE, CONV_STATE,
444 $ NOPROG_STATE, BASE_RESIDUAL, EXTRA_RESIDUAL,
446 parameter( unstable_state = 0, working_state = 1,
447 $ conv_state = 2, noprog_state = 3 )
448 parameter( base_residual = 0, extra_residual = 1,
450 INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
451 INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
452 INTEGER CMP_ERR_I, PIV_GROWTH_I
453 PARAMETER ( FINAL_NRM_ERR_I = 1, final_cmp_err_i = 2,
455 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
456 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
458 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
460 parameter( la_linrx_itref_i = 1,
461 $ la_linrx_ithresh_i = 2 )
462 parameter( la_linrx_cwise_i = 3 )
463 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
465 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
466 parameter( la_linrx_rcond_i = 3 )
472 DOUBLE PRECISION DLAMCH
473 CHARACTER CHLA_TRANSTYPE
476 INTRINSIC abs, max, min
480 IF (info.NE.0)
RETURN
481 trans = chla_transtype(trans_type)
482 eps = dlamch(
'Epsilon' )
483 hugeval = dlamch(
'Overflow' )
485 hugeval = hugeval * hugeval
487 incr_thresh = dble( n ) * eps
491 y_prec_state = extra_residual
492 IF ( y_prec_state .EQ. extra_y )
THEN
509 x_state = working_state
510 z_state = unstable_state
518 CALL dcopy( n, b( 1, j ), 1, res, 1 )
519 IF ( y_prec_state .EQ. base_residual )
THEN
520 CALL dgbmv( trans, m, n, kl, ku, -1.0d+0, ab, ldab,
521 $ y( 1, j ), 1, 1.0d+0, res, 1 )
522 ELSE IF ( y_prec_state .EQ. extra_residual )
THEN
523 CALL blas_dgbmv_x( trans_type, n, n, kl, ku,
524 $ -1.0d+0, ab, ldab, y( 1, j ), 1, 1.0d+0, res, 1,
527 CALL blas_dgbmv2_x( trans_type, n, n, kl, ku, -1.0d+0,
528 $ ab, ldab, y( 1, j ), y_tail, 1, 1.0d+0, res, 1,
533 CALL dcopy( n, res, 1, dy, 1 )
534 CALL dgbtrs( trans, n, kl, ku, 1, afb, ldafb, ipiv, dy, n,
546 yk = abs( y( i, j ) )
549 IF ( yk .NE. 0.0d+0 )
THEN
550 dz_z = max( dz_z, dyk / yk )
551 ELSE IF ( dyk .NE. 0.0d+0 )
THEN
555 ymin = min( ymin, yk )
557 normy = max( normy, yk )
560 normx = max( normx, yk * c( i ) )
561 normdx = max( normdx, dyk * c( i ) )
564 normdx = max( normdx, dyk )
568 IF ( normx .NE. 0.0d+0 )
THEN
569 dx_x = normdx / normx
570 ELSE IF ( normdx .EQ. 0.0d+0 )
THEN
576 dxrat = normdx / prevnormdx
577 dzrat = dz_z / prev_dz_z
581 IF ( .NOT.ignore_cwise
582 $ .AND. ymin*rcond .LT. incr_thresh*normy
583 $ .AND. y_prec_state .LT. extra_y )
586 IF ( x_state .EQ. noprog_state .AND. dxrat .LE. rthresh )
587 $ x_state = working_state
588 IF ( x_state .EQ. working_state )
THEN
589 IF ( dx_x .LE. eps )
THEN
591 ELSE IF ( dxrat .GT. rthresh )
THEN
592 IF ( y_prec_state .NE. extra_y )
THEN
595 x_state = noprog_state
598 IF ( dxrat .GT. dxratmax ) dxratmax = dxrat
600 IF ( x_state .GT. working_state ) final_dx_x = dx_x
603 IF ( z_state .EQ. unstable_state .AND. dz_z .LE. dz_ub )
604 $ z_state = working_state
605 IF ( z_state .EQ. noprog_state .AND. dzrat .LE. rthresh )
606 $ z_state = working_state
607 IF ( z_state .EQ. working_state )
THEN
608 IF ( dz_z .LE. eps )
THEN
610 ELSE IF ( dz_z .GT. dz_ub )
THEN
611 z_state = unstable_state
614 ELSE IF ( dzrat .GT. rthresh )
THEN
615 IF ( y_prec_state .NE. extra_y )
THEN
618 z_state = noprog_state
621 IF ( dzrat .GT. dzratmax ) dzratmax = dzrat
623 IF ( z_state .GT. working_state ) final_dz_z = dz_z
630 IF ( x_state.NE.working_state )
THEN
631 IF ( ignore_cwise )
GOTO 666
632 IF ( z_state.EQ.noprog_state .OR. z_state.EQ.conv_state )
634 IF ( z_state.EQ.unstable_state .AND. cnt.GT.1 )
GOTO 666
637 IF ( incr_prec )
THEN
639 y_prec_state = y_prec_state + 1
650 IF (y_prec_state .LT. extra_y)
THEN
651 CALL daxpy( n, 1.0d+0, dy, 1, y(1,j), 1 )
662 IF ( x_state .EQ. working_state ) final_dx_x = dx_x
663 IF ( z_state .EQ. working_state ) final_dz_z = dz_z
667 IF ( n_norms .GE. 1 )
THEN
668 err_bnds_norm( j, la_linrx_err_i ) =
669 $ final_dx_x / (1 - dxratmax)
671 IF (n_norms .GE. 2)
THEN
672 err_bnds_comp( j, la_linrx_err_i ) =
673 $ final_dz_z / (1 - dzratmax)
684 CALL dcopy( n, b( 1, j ), 1, res, 1 )
685 CALL dgbmv(trans, n, n, kl, ku, -1.0d+0, ab, ldab, y(1,j),
686 $ 1, 1.0d+0, res, 1 )
689 ayb( i ) = abs( b( i, j ) )
694 CALL dla_gbamv( trans_type, n, n, kl, ku, 1.0d+0,
695 $ ab, ldab, y(1, j), 1, 1.0d+0, ayb, 1 )
subroutine daxpy(n, da, dx, incx, dy, incy)
DAXPY
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dgbmv(trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy)
DGBMV
subroutine dgbtrs(trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info)
DGBTRS
subroutine dla_gbamv(trans, m, n, kl, ku, alpha, ab, ldab, x, incx, beta, y, incy)
DLA_GBAMV performs a matrix-vector operation to calculate error bounds.
subroutine dla_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)
DLA_GBRFSX_EXTENDED improves the computed solution to a system of linear equations for general banded...
subroutine dla_lin_berr(n, nz, nrhs, res, ayb, berr)
DLA_LIN_BERR computes a component-wise relative backward error.
character *1 function chla_transtype(trans)
CHLA_TRANSTYPE
subroutine dla_wwaddw(n, x, y, w)
DLA_WWADDW adds a vector into a doubled-single vector.
double precision function dlamch(cmach)
DLAMCH