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 COMPLEX 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
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 )
473 CHARACTER CHLA_TRANSTYPE
476 INTRINSIC abs, max, min
482 cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
486 IF (info.NE.0)
RETURN
487 trans = chla_transtype(trans_type)
488 eps = slamch(
'Epsilon' )
489 hugeval = slamch(
'Overflow' )
491 hugeval = hugeval * hugeval
493 incr_thresh = real( n ) * eps
497 y_prec_state = extra_residual
498 IF ( y_prec_state .EQ. extra_y )
then
515 x_state = working_state
516 z_state = unstable_state
524 CALL ccopy( n, b( 1, j ), 1, res, 1 )
525 IF ( y_prec_state .EQ. base_residual )
THEN
526 CALL cgbmv( trans, m, n, kl, ku, (-1.0e+0,0.0e+0), ab,
527 $ ldab, y( 1, j ), 1, (1.0e+0,0.0e+0), res, 1 )
528 ELSE IF ( y_prec_state .EQ. extra_residual )
THEN
529 CALL blas_cgbmv_x( trans_type, n, n, kl, ku,
530 $ (-1.0e+0,0.0e+0), ab, ldab, y( 1, j ), 1,
531 $ (1.0e+0,0.0e+0), res, 1, prec_type )
533 CALL blas_cgbmv2_x( trans_type, n, n, kl, ku,
534 $ (-1.0e+0,0.0e+0), ab, ldab, y( 1, j ), y_tail, 1,
535 $ (1.0e+0,0.0e+0), res, 1, prec_type )
539 CALL ccopy( n, res, 1, dy, 1 )
540 CALL cgbtrs( trans, n, kl, ku, 1, afb, ldafb, ipiv, dy, n,
552 yk = cabs1( y( i, j ) )
553 dyk = cabs1( dy( i ) )
555 IF (yk .NE. 0.0)
THEN
556 dz_z = max( dz_z, dyk / yk )
557 ELSE IF ( dyk .NE. 0.0 )
THEN
561 ymin = min( ymin, yk )
563 normy = max( normy, yk )
566 normx = max( normx, yk * c( i ) )
567 normdx = max(normdx, dyk * c(i))
570 normdx = max( normdx, dyk )
574 IF ( normx .NE. 0.0 )
THEN
575 dx_x = normdx / normx
576 ELSE IF ( normdx .EQ. 0.0 )
THEN
582 dxrat = normdx / prevnormdx
583 dzrat = dz_z / prev_dz_z
587 IF (.NOT.ignore_cwise
588 $ .AND. ymin*rcond .LT. incr_thresh*normy
589 $ .AND. y_prec_state .LT. extra_y )
592 IF ( x_state .EQ. noprog_state .AND. dxrat .LE. rthresh )
593 $ x_state = working_state
594 IF ( x_state .EQ. working_state )
THEN
595 IF ( dx_x .LE. eps )
THEN
597 ELSE IF ( dxrat .GT. rthresh )
THEN
598 IF ( y_prec_state .NE. extra_y )
THEN
601 x_state = noprog_state
604 IF ( dxrat .GT. dxratmax ) dxratmax = dxrat
606 IF ( x_state .GT. working_state ) final_dx_x = dx_x
609 IF ( z_state .EQ. unstable_state .AND. dz_z .LE. dz_ub )
610 $ z_state = working_state
611 IF ( z_state .EQ. noprog_state .AND. dzrat .LE. rthresh )
612 $ z_state = working_state
613 IF ( z_state .EQ. working_state )
THEN
614 IF ( dz_z .LE. eps )
THEN
616 ELSE IF ( dz_z .GT. dz_ub )
THEN
617 z_state = unstable_state
620 ELSE IF ( dzrat .GT. rthresh )
THEN
621 IF ( y_prec_state .NE. extra_y )
THEN
624 z_state = noprog_state
627 IF ( dzrat .GT. dzratmax ) dzratmax = dzrat
629 IF ( z_state .GT. working_state ) final_dz_z = dz_z
636 IF ( x_state.NE.working_state )
THEN
637 IF ( ignore_cwise )
GOTO 666
638 IF ( z_state.EQ.noprog_state .OR. z_state.EQ.conv_state )
640 IF ( z_state.EQ.unstable_state .AND. cnt.GT.1 )
GOTO 666
643 IF ( incr_prec )
THEN
645 y_prec_state = y_prec_state + 1
656 IF ( y_prec_state .LT. extra_y )
THEN
657 CALL caxpy( n, (1.0e+0,0.0e+0), dy, 1, y(1,j), 1 )
668 IF ( x_state .EQ. working_state ) final_dx_x = dx_x
669 IF ( z_state .EQ. working_state ) final_dz_z = dz_z
673 IF ( n_norms .GE. 1 )
THEN
674 err_bnds_norm( j, la_linrx_err_i ) =
675 $ final_dx_x / (1 - dxratmax)
677 IF ( n_norms .GE. 2 )
THEN
678 err_bnds_comp( j, la_linrx_err_i ) =
679 $ final_dz_z / (1 - dzratmax)
690 CALL ccopy( n, b( 1, j ), 1, res, 1 )
691 CALL cgbmv( trans, n, n, kl, ku, (-1.0e+0,0.0e+0), ab, ldab,
692 $ y(1,j), 1, (1.0e+0,0.0e+0), res, 1 )
695 ayb( i ) = cabs1( b( i, j ) )
700 CALL cla_gbamv( trans_type, n, n, kl, ku, 1.0e+0,
701 $ ab, ldab, y(1, j), 1, 1.0e+0, ayb, 1 )
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine cgbmv(trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy)
CGBMV
subroutine cgbtrs(trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info)
CGBTRS
subroutine cla_gbamv(trans, m, n, kl, ku, alpha, ab, ldab, x, incx, beta, y, incy)
CLA_GBAMV performs a matrix-vector operation to calculate error bounds.
subroutine cla_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)
CLA_GBRFSX_EXTENDED improves the computed solution to a system of linear equations for general banded...
subroutine cla_lin_berr(n, nz, nrhs, res, ayb, berr)
CLA_LIN_BERR computes a component-wise relative backward error.
character *1 function chla_transtype(trans)
CHLA_TRANSTYPE
subroutine cla_wwaddw(n, x, y, w)
CLA_WWADDW adds a vector into a doubled-single vector.
real function slamch(cmach)
SLAMCH