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
419 DOUBLE PRECISION RTHRESH, DZ_UB
423 DOUBLE PRECISION AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ),
424 $ Y( LDY, * ), RES(*), DY(*), Y_TAIL(*)
425 DOUBLE PRECISION 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 DOUBLE PRECISION 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 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,
547 yk = abs( y( i, j ) )
550 IF ( yk .NE. 0.0d+0 )
THEN
551 dz_z = max( dz_z, dyk / yk )
552 ELSE IF ( dyk .NE. 0.0d+0 )
THEN
556 ymin = min( ymin, yk )
558 normy = max( normy, yk )
561 normx = max( normx, yk * c( i ) )
562 normdx = max( normdx, dyk * c( i ) )
565 normdx = max( normdx, dyk )
569 IF ( normx .NE. 0.0d+0 )
THEN
570 dx_x = normdx / normx
571 ELSE IF ( normdx .EQ. 0.0d+0 )
THEN
577 dxrat = normdx / prevnormdx
578 dzrat = dz_z / prev_dz_z
582 IF ( .NOT.ignore_cwise
583 $ .AND. ymin*rcond .LT. incr_thresh*normy
584 $ .AND. y_prec_state .LT. extra_y )
587 IF ( x_state .EQ. noprog_state .AND. dxrat .LE. rthresh )
588 $ x_state = working_state
589 IF ( x_state .EQ. working_state )
THEN
590 IF ( dx_x .LE. eps )
THEN
592 ELSE IF ( dxrat .GT. rthresh )
THEN
593 IF ( y_prec_state .NE. extra_y )
THEN
596 x_state = noprog_state
599 IF ( dxrat .GT. dxratmax ) dxratmax = dxrat
601 IF ( x_state .GT. working_state ) final_dx_x = dx_x
604 IF ( z_state .EQ. unstable_state .AND. dz_z .LE. dz_ub )
605 $ z_state = working_state
606 IF ( z_state .EQ. noprog_state .AND. dzrat .LE. rthresh )
607 $ z_state = working_state
608 IF ( z_state .EQ. working_state )
THEN
609 IF ( dz_z .LE. eps )
THEN
611 ELSE IF ( dz_z .GT. dz_ub )
THEN
612 z_state = unstable_state
615 ELSE IF ( dzrat .GT. rthresh )
THEN
616 IF ( y_prec_state .NE. extra_y )
THEN
619 z_state = noprog_state
622 IF ( dzrat .GT. dzratmax ) dzratmax = dzrat
624 IF ( z_state .GT. working_state ) final_dz_z = dz_z
631 IF ( x_state.NE.working_state )
THEN
632 IF ( ignore_cwise )
GOTO 666
633 IF ( z_state.EQ.noprog_state .OR. z_state.EQ.conv_state )
635 IF ( z_state.EQ.unstable_state .AND. cnt.GT.1 )
GOTO 666
638 IF ( incr_prec )
THEN
640 y_prec_state = y_prec_state + 1
651 IF (y_prec_state .LT. extra_y)
THEN
652 CALL daxpy( n, 1.0d+0, dy, 1, y(1,j), 1 )
663 IF ( x_state .EQ. working_state ) final_dx_x = dx_x
664 IF ( z_state .EQ. working_state ) final_dz_z = dz_z
668 IF ( n_norms .GE. 1 )
THEN
669 err_bnds_norm( j, la_linrx_err_i ) =
670 $ final_dx_x / (1 - dxratmax)
672 IF (n_norms .GE. 2)
THEN
673 err_bnds_comp( j, la_linrx_err_i ) =
674 $ final_dz_z / (1 - dzratmax)
685 CALL dcopy( n, b( 1, j ), 1, res, 1 )
686 CALL dgbmv(trans, n, n, kl, ku, -1.0d+0, ab, ldab, y(1,j),
687 $ 1, 1.0d+0, res, 1 )
690 ayb( i ) = abs( b( i, j ) )
695 CALL dla_gbamv( trans_type, n, n, kl, ku, 1.0d+0,
696 $ ab, ldab, y(1, j), 1, 1.0d+0, ayb, 1 )