396 $ lda, af, ldaf, ipiv, colequ, c, b,
397 $ ldb, y, ldy, berr_out, n_norms,
398 $ errs_n, errs_c, res, ayb, dy,
399 $ y_tail, rcond, ithresh, rthresh,
400 $ dz_ub, ignore_cwise, info )
408 INTEGER INFO, LDA, LDAF, LDB, LDY, N, NRHS, PREC_TYPE,
409 $ trans_type, n_norms, ithresh
410 LOGICAL COLEQU, IGNORE_CWISE
411 DOUBLE PRECISION RTHRESH, DZ_UB
415 DOUBLE PRECISION A( lda, * ), AF( ldaf, * ), B( ldb, * ),
416 $ y( ldy, * ), res( * ), dy( * ), y_tail( * )
417 DOUBLE PRECISION C( * ), AYB( * ), RCOND, BERR_OUT( * ),
418 $ errs_n( nrhs, * ), errs_c( nrhs, * )
425 INTEGER CNT, I, J, X_STATE, Z_STATE, Y_PREC_STATE
426 DOUBLE PRECISION YK, DYK, YMIN, NORMY, NORMX, NORMDX, DXRAT,
427 $ dzrat, prevnormdx, prev_dz_z, dxratmax,
428 $ dzratmax, dx_x, dz_z, final_dx_x, final_dz_z,
429 $ eps, hugeval, incr_thresh
433 INTEGER UNSTABLE_STATE, WORKING_STATE, CONV_STATE,
434 $ noprog_state, base_residual, extra_residual,
436 parameter ( unstable_state = 0, working_state = 1,
437 $ conv_state = 2, noprog_state = 3 )
438 parameter ( base_residual = 0, extra_residual = 1,
440 INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
441 INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
442 INTEGER CMP_ERR_I, PIV_GROWTH_I
443 parameter ( final_nrm_err_i = 1, final_cmp_err_i = 2,
445 parameter ( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
446 parameter ( cmp_rcond_i = 7, cmp_err_i = 8,
448 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
450 parameter ( la_linrx_itref_i = 1,
451 $ la_linrx_ithresh_i = 2 )
452 parameter ( la_linrx_cwise_i = 3 )
453 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
455 parameter ( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
456 parameter ( la_linrx_rcond_i = 3 )
462 DOUBLE PRECISION DLAMCH
463 CHARACTER CHLA_TRANSTYPE
466 INTRINSIC abs, max, min
470 IF ( info.NE.0 )
RETURN
471 trans = chla_transtype(trans_type)
472 eps = dlamch(
'Epsilon' )
473 hugeval = dlamch(
'Overflow' )
475 hugeval = hugeval * hugeval
477 incr_thresh = dble( n ) * eps
480 y_prec_state = extra_residual
481 IF ( y_prec_state .EQ. extra_y )
THEN
498 x_state = working_state
499 z_state = unstable_state
507 CALL dcopy( n, b( 1, j ), 1, res, 1 )
508 IF ( y_prec_state .EQ. base_residual )
THEN
509 CALL dgemv( trans, n, n, -1.0d+0, a, lda, y( 1, j ), 1,
511 ELSE IF ( y_prec_state .EQ. extra_residual )
THEN
512 CALL blas_dgemv_x( trans_type, n, n, -1.0d+0, a, lda,
513 $ y( 1, j ), 1, 1.0d+0, res, 1, prec_type )
515 CALL blas_dgemv2_x( trans_type, n, n, -1.0d+0, a, lda,
516 $ y( 1, j ), y_tail, 1, 1.0d+0, res, 1, prec_type )
520 CALL dcopy( n, res, 1, dy, 1 )
521 CALL dgetrs( trans, n, 1, af, ldaf, ipiv, dy, n, info )
532 yk = abs( y( i, j ) )
535 IF ( yk .NE. 0.0d+0 )
THEN
536 dz_z = max( dz_z, dyk / yk )
537 ELSE IF ( dyk .NE. 0.0d+0 )
THEN
541 ymin = min( ymin, yk )
543 normy = max( normy, yk )
546 normx = max( normx, yk * c( i ) )
547 normdx = max( normdx, dyk * c( i ) )
550 normdx = max( normdx, dyk )
554 IF ( normx .NE. 0.0d+0 )
THEN
555 dx_x = normdx / normx
556 ELSE IF ( normdx .EQ. 0.0d+0 )
THEN
562 dxrat = normdx / prevnormdx
563 dzrat = dz_z / prev_dz_z
567 IF (.NOT.ignore_cwise
568 $ .AND. ymin*rcond .LT. incr_thresh*normy
569 $ .AND. y_prec_state .LT. extra_y)
572 IF ( x_state .EQ. noprog_state .AND. dxrat .LE. rthresh )
573 $ x_state = working_state
574 IF ( x_state .EQ. working_state )
THEN
575 IF ( dx_x .LE. eps )
THEN
577 ELSE IF ( dxrat .GT. rthresh )
THEN
578 IF ( y_prec_state .NE. extra_y )
THEN
581 x_state = noprog_state
584 IF ( dxrat .GT. dxratmax ) dxratmax = dxrat
586 IF ( x_state .GT. working_state ) final_dx_x = dx_x
589 IF ( z_state .EQ. unstable_state .AND. dz_z .LE. dz_ub )
590 $ z_state = working_state
591 IF ( z_state .EQ. noprog_state .AND. dzrat .LE. rthresh )
592 $ z_state = working_state
593 IF ( z_state .EQ. working_state )
THEN
594 IF ( dz_z .LE. eps )
THEN
596 ELSE IF ( dz_z .GT. dz_ub )
THEN
597 z_state = unstable_state
600 ELSE IF ( dzrat .GT. rthresh )
THEN
601 IF ( y_prec_state .NE. extra_y )
THEN
604 z_state = noprog_state
607 IF ( dzrat .GT. dzratmax ) dzratmax = dzrat
609 IF ( z_state .GT. working_state ) final_dz_z = dz_z
616 IF ( x_state.NE.working_state )
THEN
617 IF ( ignore_cwise)
GOTO 666
618 IF ( z_state.EQ.noprog_state .OR. z_state.EQ.conv_state )
620 IF ( z_state.EQ.unstable_state .AND. cnt.GT.1 )
GOTO 666
623 IF ( incr_prec )
THEN
625 y_prec_state = y_prec_state + 1
636 IF ( y_prec_state .LT. extra_y )
THEN
637 CALL daxpy( n, 1.0d+0, dy, 1, y( 1, j ), 1 )
648 IF ( x_state .EQ. working_state ) final_dx_x = dx_x
649 IF ( z_state .EQ. working_state ) final_dz_z = dz_z
653 IF (n_norms .GE. 1)
THEN
654 errs_n( j, la_linrx_err_i ) = final_dx_x / (1 - dxratmax)
656 IF ( n_norms .GE. 2 )
THEN
657 errs_c( j, la_linrx_err_i ) = final_dz_z / (1 - dzratmax)
668 CALL dcopy( n, b( 1, j ), 1, res, 1 )
669 CALL dgemv( trans, n, n, -1.0d+0, a, lda, y(1,j), 1, 1.0d+0,
673 ayb( i ) = abs( b( i, j ) )
678 CALL dla_geamv ( trans_type, n, n, 1.0d+0,
679 $ a, lda, y(1, j), 1, 1.0d+0, ayb, 1 )
subroutine dcopy(N, DX, INCX, DY, INCY)
DCOPY
double precision function dlamch(CMACH)
DLAMCH
subroutine dla_lin_berr(N, NZ, NRHS, RES, AYB, BERR)
DLA_LIN_BERR computes a component-wise relative backward error.
subroutine dgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
DGEMV
subroutine daxpy(N, DA, DX, INCX, DY, INCY)
DAXPY
subroutine dgetrs(TRANS, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
DGETRS
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...
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.
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...