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 )
character *1 function chla_transtype(TRANS)
CHLA_TRANSTYPE
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...
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
double precision function dlamch(CMACH)
DLAMCH
subroutine daxpy(N, DA, DX, INCX, DY, INCY)
DAXPY
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...
subroutine dcopy(N, DX, INCX, DY, INCY)
DCOPY