392 $ LDA, AF, LDAF, IPIV, COLEQU, C, B,
393 $ LDB, Y, LDY, BERR_OUT, N_NORMS,
394 $ ERRS_N, ERRS_C, RES, AYB, DY,
395 $ Y_TAIL, RCOND, ITHRESH, RTHRESH,
396 $ DZ_UB, IGNORE_CWISE, INFO )
403 INTEGER INFO, LDA, LDAF, LDB, LDY, N, NRHS, PREC_TYPE,
404 $ TRANS_TYPE, N_NORMS
405 LOGICAL COLEQU, IGNORE_CWISE
411 COMPLEX A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
412 $ y( ldy, * ), res( * ), dy( * ), y_tail( * )
413 REAL C( * ), AYB( * ), RCOND, BERR_OUT( * ),
414 $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * )
421 INTEGER CNT, I, J, X_STATE, Z_STATE, Y_PREC_STATE
422 REAL YK, DYK, YMIN, NORMY, NORMX, NORMDX, DXRAT,
423 $ DZRAT, PREVNORMDX, PREV_DZ_Z, DXRATMAX,
424 $ DZRATMAX, DX_X, DZ_Z, FINAL_DX_X, FINAL_DZ_Z,
425 $ eps, hugeval, incr_thresh
430 INTEGER UNSTABLE_STATE, WORKING_STATE, CONV_STATE,
431 $ noprog_state, base_residual, extra_residual,
433 parameter( unstable_state = 0, working_state = 1,
436 parameter( base_residual = 0, extra_residual = 1,
438 INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
439 INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
440 INTEGER CMP_ERR_I, PIV_GROWTH_I
441 parameter( final_nrm_err_i = 1, final_cmp_err_i = 2,
443 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
444 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
446 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
448 parameter( la_linrx_itref_i = 1,
449 $ la_linrx_ithresh_i = 2 )
450 parameter( la_linrx_cwise_i = 3 )
451 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
453 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
454 parameter( la_linrx_rcond_i = 3 )
461 CHARACTER CHLA_TRANSTYPE
464 INTRINSIC abs, max, min
470 cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
474 IF ( info.NE.0 )
RETURN
475 trans = chla_transtype(trans_type)
476 eps = slamch(
'Epsilon' )
477 hugeval = slamch(
'Overflow' )
479 hugeval = hugeval * hugeval
481 incr_thresh = real( n ) * eps
484 y_prec_state = extra_residual
485 IF ( y_prec_state .EQ. extra_y )
THEN
502 x_state = working_state
503 z_state = unstable_state
511 CALL ccopy( n, b( 1, j ), 1, res, 1 )
512 IF ( y_prec_state .EQ. base_residual )
THEN
513 CALL cgemv( trans, n, n, (-1.0e+0,0.0e+0), a, lda,
514 $ y( 1, j ), 1, (1.0e+0,0.0e+0), res, 1)
515 ELSE IF (y_prec_state .EQ. extra_residual)
THEN
516 CALL blas_cgemv_x( trans_type, n, n, (-1.0e+0,0.0e+0), a,
517 $ lda, y( 1, j ), 1, (1.0e+0,0.0e+0),
518 $ res, 1, prec_type )
520 CALL blas_cgemv2_x( trans_type, n, n, (-1.0e+0,0.0e+0),
521 $ a, lda, y(1, j), y_tail, 1, (1.0e+0,0.0e+0), res, 1,
526 CALL ccopy( n, res, 1, dy, 1 )
527 CALL cgetrs( trans, n, 1, af, ldaf, ipiv, dy, n, info )
538 yk = cabs1( y( i, j ) )
539 dyk = cabs1( dy( i ) )
541 IF ( yk .NE. 0.0e+0 )
THEN
542 dz_z = max( dz_z, dyk / yk )
543 ELSE IF ( dyk .NE. 0.0 )
THEN
547 ymin = min( ymin, yk )
549 normy = max( normy, yk )
552 normx = max( normx, yk * c( i ) )
553 normdx = max( normdx, dyk * c( i ) )
556 normdx = max(normdx, dyk)
560 IF ( normx .NE. 0.0 )
THEN
561 dx_x = normdx / normx
562 ELSE IF ( normdx .EQ. 0.0 )
THEN
568 dxrat = normdx / prevnormdx
569 dzrat = dz_z / prev_dz_z
573 IF (.NOT.ignore_cwise
574 $ .AND. ymin*rcond .LT. incr_thresh*normy
575 $ .AND. y_prec_state .LT. extra_y )
578 IF ( x_state .EQ. noprog_state .AND. dxrat .LE. rthresh )
579 $ x_state = working_state
580 IF ( x_state .EQ. working_state )
THEN
581 IF (dx_x .LE. eps)
THEN
583 ELSE IF ( dxrat .GT. rthresh )
THEN
584 IF ( y_prec_state .NE. extra_y )
THEN
587 x_state = noprog_state
590 IF ( dxrat .GT. dxratmax ) dxratmax = dxrat
592 IF ( x_state .GT. working_state ) final_dx_x = dx_x
595 IF ( z_state .EQ. unstable_state .AND. dz_z .LE. dz_ub )
596 $ z_state = working_state
597 IF ( z_state .EQ. noprog_state .AND. dzrat .LE. rthresh )
598 $ z_state = working_state
599 IF ( z_state .EQ. working_state )
THEN
600 IF ( dz_z .LE. eps )
THEN
602 ELSE IF ( dz_z .GT. dz_ub )
THEN
603 z_state = unstable_state
606 ELSE IF ( dzrat .GT. rthresh )
THEN
607 IF ( y_prec_state .NE. extra_y )
THEN
610 z_state = noprog_state
613 IF ( dzrat .GT. dzratmax ) dzratmax = dzrat
615 IF ( z_state .GT. working_state ) final_dz_z = dz_z
622 IF ( x_state.NE.working_state )
THEN
623 IF ( ignore_cwise )
GOTO 666
624 IF ( z_state.EQ.noprog_state .OR. z_state.EQ.conv_state )
626 IF ( z_state.EQ.unstable_state .AND. cnt.GT.1 )
GOTO 666
629 IF ( incr_prec )
THEN
631 y_prec_state = y_prec_state + 1
642 IF ( y_prec_state .LT. extra_y )
THEN
643 CALL caxpy( n, (1.0e+0,0.0e+0), dy, 1, y(1,j), 1 )
654 IF ( x_state .EQ. working_state ) final_dx_x = dx_x
655 IF ( z_state .EQ. working_state ) final_dz_z = dz_z
659 IF (n_norms .GE. 1)
THEN
660 errs_n( j, la_linrx_err_i ) = final_dx_x / (1 - dxratmax)
663 IF ( n_norms .GE. 2 )
THEN
664 errs_c( j, la_linrx_err_i ) = final_dz_z / (1 - dzratmax)
675 CALL ccopy( n, b( 1, j ), 1, res, 1 )
676 CALL cgemv( trans, n, n, (-1.0e+0,0.0e+0), a, lda, y(1,j), 1,
677 $ (1.0e+0,0.0e+0), res, 1 )
680 ayb( i ) = cabs1( b( i, j ) )
685 CALL cla_geamv ( trans_type, n, n, 1.0e+0,
686 $ a, lda, 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 cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine cgetrs(trans, n, nrhs, a, lda, ipiv, b, ldb, info)
CGETRS
subroutine cla_geamv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CLA_GEAMV computes a matrix-vector product using a general matrix to calculate error bounds.
subroutine cla_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)
CLA_GERFSX_EXTENDED
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