391 $ LDA, AF, LDAF, IPIV, COLEQU, C, B,
392 $ LDB, Y, LDY, BERR_OUT, N_NORMS,
393 $ ERRS_N, ERRS_C, RES, AYB, DY,
394 $ Y_TAIL, RCOND, ITHRESH, RTHRESH,
395 $ DZ_UB, IGNORE_CWISE, INFO )
402 INTEGER INFO, LDA, LDAF, LDB, LDY, N, NRHS, PREC_TYPE,
403 $ TRANS_TYPE, N_NORMS, ITHRESH
404 LOGICAL COLEQU, IGNORE_CWISE
405 DOUBLE PRECISION RTHRESH, DZ_UB
409 DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
410 $ y( ldy, * ), res( * ), dy( * ), y_tail( * )
411 DOUBLE PRECISION C( * ), AYB( * ), RCOND, BERR_OUT( * ),
412 $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * )
419 INTEGER CNT, I, J, X_STATE, Z_STATE, Y_PREC_STATE
420 DOUBLE PRECISION YK, DYK, YMIN, NORMY, NORMX, NORMDX, DXRAT,
421 $ DZRAT, PREVNORMDX, PREV_DZ_Z, DXRATMAX,
422 $ DZRATMAX, DX_X, DZ_Z, FINAL_DX_X, FINAL_DZ_Z,
423 $ eps, hugeval, incr_thresh
427 INTEGER UNSTABLE_STATE, WORKING_STATE, CONV_STATE,
428 $ NOPROG_STATE, BASE_RESIDUAL, EXTRA_RESIDUAL,
430 parameter( unstable_state = 0, working_state = 1,
431 $ conv_state = 2, noprog_state = 3 )
432 parameter( base_residual = 0, extra_residual = 1,
434 INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
435 INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
436 INTEGER CMP_ERR_I, PIV_GROWTH_I
437 parameter( final_nrm_err_i = 1, final_cmp_err_i = 2,
439 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
440 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
442 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
444 parameter( la_linrx_itref_i = 1,
445 $ la_linrx_ithresh_i = 2 )
446 parameter( la_linrx_cwise_i = 3 )
447 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
449 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
450 parameter( la_linrx_rcond_i = 3 )
456 DOUBLE PRECISION DLAMCH
457 CHARACTER CHLA_TRANSTYPE
460 INTRINSIC abs, max, min
464 IF ( info.NE.0 )
RETURN
465 trans = chla_transtype(trans_type)
466 eps = dlamch(
'Epsilon' )
467 hugeval = dlamch(
'Overflow' )
469 hugeval = hugeval * hugeval
471 incr_thresh = dble( n ) * eps
474 y_prec_state = extra_residual
475 IF ( y_prec_state .EQ. extra_y )
THEN
492 x_state = working_state
493 z_state = unstable_state
501 CALL dcopy( n, b( 1, j ), 1, res, 1 )
502 IF ( y_prec_state .EQ. base_residual )
THEN
503 CALL dgemv( trans, n, n, -1.0d+0, a, lda, y( 1, j ), 1,
505 ELSE IF ( y_prec_state .EQ. extra_residual )
THEN
506 CALL blas_dgemv_x( trans_type, n, n, -1.0d+0, a, lda,
507 $ y( 1, j ), 1, 1.0d+0, res, 1, prec_type )
509 CALL blas_dgemv2_x( trans_type, n, n, -1.0d+0, a, lda,
510 $ y( 1, j ), y_tail, 1, 1.0d+0, res, 1, prec_type )
514 CALL dcopy( n, res, 1, dy, 1 )
515 CALL dgetrs( trans, n, 1, af, ldaf, ipiv, dy, n, info )
526 yk = abs( y( i, j ) )
529 IF ( yk .NE. 0.0d+0 )
THEN
530 dz_z = max( dz_z, dyk / yk )
531 ELSE IF ( dyk .NE. 0.0d+0 )
THEN
535 ymin = min( ymin, yk )
537 normy = max( normy, yk )
540 normx = max( normx, yk * c( i ) )
541 normdx = max( normdx, dyk * c( i ) )
544 normdx = max( normdx, dyk )
548 IF ( normx .NE. 0.0d+0 )
THEN
549 dx_x = normdx / normx
550 ELSE IF ( normdx .EQ. 0.0d+0 )
THEN
556 dxrat = normdx / prevnormdx
557 dzrat = dz_z / prev_dz_z
561 IF (.NOT.ignore_cwise
562 $ .AND. ymin*rcond .LT. incr_thresh*normy
563 $ .AND. y_prec_state .LT. extra_y)
566 IF ( x_state .EQ. noprog_state .AND. dxrat .LE. rthresh )
567 $ x_state = working_state
568 IF ( x_state .EQ. working_state )
THEN
569 IF ( dx_x .LE. eps )
THEN
571 ELSE IF ( dxrat .GT. rthresh )
THEN
572 IF ( y_prec_state .NE. extra_y )
THEN
575 x_state = noprog_state
578 IF ( dxrat .GT. dxratmax ) dxratmax = dxrat
580 IF ( x_state .GT. working_state ) final_dx_x = dx_x
583 IF ( z_state .EQ. unstable_state .AND. dz_z .LE. dz_ub )
584 $ z_state = working_state
585 IF ( z_state .EQ. noprog_state .AND. dzrat .LE. rthresh )
586 $ z_state = working_state
587 IF ( z_state .EQ. working_state )
THEN
588 IF ( dz_z .LE. eps )
THEN
590 ELSE IF ( dz_z .GT. dz_ub )
THEN
591 z_state = unstable_state
594 ELSE IF ( dzrat .GT. rthresh )
THEN
595 IF ( y_prec_state .NE. extra_y )
THEN
598 z_state = noprog_state
601 IF ( dzrat .GT. dzratmax ) dzratmax = dzrat
603 IF ( z_state .GT. working_state ) final_dz_z = dz_z
610 IF ( x_state.NE.working_state )
THEN
611 IF ( ignore_cwise)
GOTO 666
612 IF ( z_state.EQ.noprog_state .OR. z_state.EQ.conv_state )
614 IF ( z_state.EQ.unstable_state .AND. cnt.GT.1 )
GOTO 666
617 IF ( incr_prec )
THEN
619 y_prec_state = y_prec_state + 1
630 IF ( y_prec_state .LT. extra_y )
THEN
631 CALL daxpy( n, 1.0d+0, dy, 1, y( 1, j ), 1 )
642 IF ( x_state .EQ. working_state ) final_dx_x = dx_x
643 IF ( z_state .EQ. working_state ) final_dz_z = dz_z
647 IF (n_norms .GE. 1)
THEN
648 errs_n( j, la_linrx_err_i ) = final_dx_x / (1 - dxratmax)
650 IF ( n_norms .GE. 2 )
THEN
651 errs_c( j, la_linrx_err_i ) = final_dz_z / (1 - dzratmax)
662 CALL dcopy( n, b( 1, j ), 1, res, 1 )
663 CALL dgemv( trans, n, n, -1.0d+0, a, lda, y(1,j), 1, 1.0d+0,
667 ayb( i ) = abs( b( i, j ) )
672 CALL dla_geamv ( trans_type, n, n, 1.0d+0,
673 $ a, lda, 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 dgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
DGEMV
subroutine dgetrs(trans, n, nrhs, a, lda, ipiv, b, ldb, info)
DGETRS
subroutine dla_geamv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
DLA_GEAMV computes a matrix-vector product using a general matrix to calculate error bounds.
subroutine dla_gerfsx_extended(prec_type, trans_type, n, nrhs, a, lda, af, ldaf, ipiv, colequ, c, b, ldb, y, ldy, berr_out, n_norms, errs_n, errs_c, res, ayb, dy, y_tail, rcond, ithresh, rthresh, dz_ub, ignore_cwise, info)
DLA_GERFSX_EXTENDED improves the computed solution to a system of linear equations for general matric...
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