394 $ af, ldaf, ipiv, colequ, c, b, ldb,
395 $ y, ldy, berr_out, n_norms,
396 $ err_bnds_norm, err_bnds_comp, res,
397 $ ayb, dy, y_tail, rcond, ithresh,
398 $ rthresh, dz_ub, ignore_cwise,
407 INTEGER INFO, LDA, LDAF, LDB, LDY, N, NRHS, PREC_TYPE,
410 LOGICAL COLEQU, IGNORE_CWISE
415 COMPLEX A( lda, * ), AF( ldaf, * ), B( ldb, * ),
416 $ y( ldy, * ), res( * ), dy( * ), y_tail( * )
417 REAL C( * ), AYB( * ), RCOND, BERR_OUT( * ),
418 $ err_bnds_norm( nrhs, * ),
419 $ err_bnds_comp( nrhs, * )
425 INTEGER UPLO2, CNT, I, J, X_STATE, Z_STATE,
427 REAL YK, DYK, YMIN, NORMY, NORMX, NORMDX, DXRAT,
428 $ dzrat, prevnormdx, prev_dz_z, dxratmax,
429 $ dzratmax, dx_x, dz_z, final_dx_x, final_dz_z,
430 $ eps, hugeval, incr_thresh
431 LOGICAL INCR_PREC, UPPER
435 INTEGER UNSTABLE_STATE, WORKING_STATE, CONV_STATE,
436 $ noprog_state, base_residual, extra_residual,
438 parameter ( unstable_state = 0, working_state = 1,
439 $ conv_state = 2, noprog_state = 3 )
440 parameter ( base_residual = 0, extra_residual = 1,
442 INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
443 INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
444 INTEGER CMP_ERR_I, PIV_GROWTH_I
445 parameter ( final_nrm_err_i = 1, final_cmp_err_i = 2,
447 parameter ( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
448 parameter ( cmp_rcond_i = 7, cmp_err_i = 8,
450 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
452 parameter ( la_linrx_itref_i = 1,
453 $ la_linrx_ithresh_i = 2 )
454 parameter ( la_linrx_cwise_i = 3 )
455 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
457 parameter ( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
458 parameter ( la_linrx_rcond_i = 3 )
472 INTRINSIC abs,
REAL, AIMAG, MAX, MIN
478 cabs1( zdum ) = abs(
REAL( ZDUM ) ) + abs( AIMAG( zdum ) )
483 upper = lsame( uplo,
'U' )
484 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
486 ELSE IF( n.LT.0 )
THEN
488 ELSE IF( nrhs.LT.0 )
THEN
490 ELSE IF( lda.LT.max( 1, n ) )
THEN
492 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
494 ELSE IF( ldb.LT.max( 1, n ) )
THEN
496 ELSE IF( ldy.LT.max( 1, n ) )
THEN
500 CALL xerbla(
'CLA_HERFSX_EXTENDED', -info )
503 eps = slamch(
'Epsilon' )
504 hugeval = slamch(
'Overflow' )
506 hugeval = hugeval * hugeval
508 incr_thresh =
REAL( N ) * EPS
510 IF ( lsame( uplo,
'L' ) )
THEN
511 uplo2 = ilauplo(
'L' )
513 uplo2 = ilauplo(
'U' )
517 y_prec_state = extra_residual
518 IF ( y_prec_state .EQ. extra_y )
THEN
535 x_state = working_state
536 z_state = unstable_state
544 CALL ccopy( n, b( 1, j ), 1, res, 1 )
545 IF ( y_prec_state .EQ. base_residual )
THEN
546 CALL chemv( uplo, n, cmplx(-1.0), a, lda, y( 1, j ), 1,
547 $ cmplx(1.0), res, 1 )
548 ELSE IF ( y_prec_state .EQ. extra_residual )
THEN
549 CALL blas_chemv_x( uplo2, n, cmplx(-1.0), a, lda,
550 $ y( 1, j ), 1, cmplx(1.0), res, 1, prec_type)
552 CALL blas_chemv2_x(uplo2, n, cmplx(-1.0), a, lda,
553 $ y(1, j), y_tail, 1, cmplx(1.0), res, 1, prec_type)
557 CALL ccopy( n, res, 1, dy, 1 )
558 CALL chetrs( uplo, n, 1, af, ldaf, ipiv, dy, n, info )
569 yk = cabs1( y( i, j ) )
570 dyk = cabs1( dy( i ) )
572 IF (yk .NE. 0.0)
THEN
573 dz_z = max( dz_z, dyk / yk )
574 ELSE IF ( dyk .NE. 0.0 )
THEN
578 ymin = min( ymin, yk )
580 normy = max( normy, yk )
583 normx = max( normx, yk * c( i ) )
584 normdx = max( normdx, dyk * c( i ) )
587 normdx = max( normdx, dyk )
591 IF ( normx .NE. 0.0 )
THEN
592 dx_x = normdx / normx
593 ELSE IF ( normdx .EQ. 0.0 )
THEN
599 dxrat = normdx / prevnormdx
600 dzrat = dz_z / prev_dz_z
604 IF ( ymin*rcond .LT. incr_thresh*normy
605 $ .AND. y_prec_state .LT. extra_y )
608 IF ( x_state .EQ. noprog_state .AND. dxrat .LE. rthresh )
609 $ x_state = working_state
610 IF ( x_state .EQ. working_state )
THEN
611 IF ( dx_x .LE. eps )
THEN
613 ELSE IF ( dxrat .GT. rthresh )
THEN
614 IF ( y_prec_state .NE. extra_y )
THEN
617 x_state = noprog_state
620 IF (dxrat .GT. dxratmax) dxratmax = dxrat
622 IF ( x_state .GT. working_state ) final_dx_x = dx_x
625 IF ( z_state .EQ. unstable_state .AND. dz_z .LE. dz_ub )
626 $ z_state = working_state
627 IF ( z_state .EQ. noprog_state .AND. dzrat .LE. rthresh )
628 $ z_state = working_state
629 IF ( z_state .EQ. working_state )
THEN
630 IF ( dz_z .LE. eps )
THEN
632 ELSE IF ( dz_z .GT. dz_ub )
THEN
633 z_state = unstable_state
636 ELSE IF ( dzrat .GT. rthresh )
THEN
637 IF ( y_prec_state .NE. extra_y )
THEN
640 z_state = noprog_state
643 IF ( dzrat .GT. dzratmax ) dzratmax = dzrat
645 IF ( z_state .GT. working_state ) final_dz_z = dz_z
648 IF ( x_state.NE.working_state.AND.
649 $ ( ignore_cwise.OR.z_state.NE.working_state ) )
652 IF ( incr_prec )
THEN
654 y_prec_state = y_prec_state + 1
665 IF ( y_prec_state .LT. extra_y )
THEN
666 CALL caxpy( n, cmplx(1.0), dy, 1, y(1,j), 1 )
677 IF ( x_state .EQ. working_state ) final_dx_x = dx_x
678 IF ( z_state .EQ. working_state ) final_dz_z = dz_z
682 IF ( n_norms .GE. 1 )
THEN
683 err_bnds_norm( j, la_linrx_err_i ) =
684 $ final_dx_x / (1 - dxratmax)
686 IF (n_norms .GE. 2)
THEN
687 err_bnds_comp( j, la_linrx_err_i ) =
688 $ final_dz_z / (1 - dzratmax)
699 CALL ccopy( n, b( 1, j ), 1, res, 1 )
700 CALL chemv( uplo, n, cmplx(-1.0), a, lda, y(1,j), 1,
701 $ cmplx(1.0), res, 1 )
704 ayb( i ) = cabs1( b( i, j ) )
710 $ a, lda, y(1, j), 1, 1.0, ayb, 1 )
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine cla_heamv(UPLO, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
CLA_HEAMV computes a matrix-vector product using a Hermitian indefinite matrix to calculate error bou...
integer function ilauplo(UPLO)
ILAUPLO
subroutine chetrs(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
CHETRS
subroutine chemv(UPLO, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
CHEMV
subroutine cla_lin_berr(N, NZ, NRHS, RES, AYB, BERR)
CLA_LIN_BERR computes a component-wise relative backward error.
subroutine cla_herfsx_extended(PREC_TYPE, UPLO, N, NRHS, A, LDA, AF, LDAF, 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_HERFSX_EXTENDED improves the computed solution to a system of linear equations for Hermitian inde...
subroutine ccopy(N, CX, INCX, CY, INCY)
CCOPY
subroutine cla_wwaddw(N, X, Y, W)
CLA_WWADDW adds a vector into a doubled-single vector.
subroutine caxpy(N, CA, CX, INCX, CY, INCY)
CAXPY