389 $ AF, LDAF, IPIV, COLEQU, C, B, LDB,
390 $ Y, LDY, BERR_OUT, N_NORMS,
391 $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES,
392 $ AYB, DY, Y_TAIL, RCOND, ITHRESH,
393 $ RTHRESH, DZ_UB, IGNORE_CWISE,
401 INTEGER INFO, LDA, LDAF, LDB, LDY, N, NRHS, PREC_TYPE,
404 LOGICAL COLEQU, IGNORE_CWISE
409 COMPLEX A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
410 $ y( ldy, * ), res( * ), dy( * ), y_tail( * )
411 REAL C( * ), AYB( * ), RCOND, BERR_OUT( * ),
412 $ ERR_BNDS_NORM( NRHS, * ),
413 $ ERR_BNDS_COMP( NRHS, * )
419 INTEGER UPLO2, CNT, I, J, X_STATE, Z_STATE,
421 REAL YK, DYK, YMIN, NORMY, NORMX, NORMDX, DXRAT,
422 $ DZRAT, PREVNORMDX, PREV_DZ_Z, DXRATMAX,
423 $ DZRATMAX, DX_X, DZ_Z, FINAL_DX_X, FINAL_DZ_Z,
424 $ EPS, HUGEVAL, INCR_THRESH
425 LOGICAL INCR_PREC, UPPER
429 INTEGER UNSTABLE_STATE, WORKING_STATE, CONV_STATE,
430 $ NOPROG_STATE, BASE_RESIDUAL, EXTRA_RESIDUAL,
432 parameter( unstable_state = 0, working_state = 1,
433 $ conv_state = 2, noprog_state = 3 )
434 parameter( base_residual = 0, extra_residual = 1,
436 INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
437 INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
438 INTEGER CMP_ERR_I, PIV_GROWTH_I
439 PARAMETER ( FINAL_NRM_ERR_I = 1, final_cmp_err_i = 2,
441 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
442 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
444 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
446 parameter( la_linrx_itref_i = 1,
447 $ la_linrx_ithresh_i = 2 )
448 parameter( la_linrx_cwise_i = 3 )
449 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
451 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
452 parameter( la_linrx_rcond_i = 3 )
466 INTRINSIC abs, real, aimag, max, min
472 cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
477 upper = lsame( uplo,
'U' )
478 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
480 ELSE IF( n.LT.0 )
THEN
482 ELSE IF( nrhs.LT.0 )
THEN
484 ELSE IF( lda.LT.max( 1, n ) )
THEN
486 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
488 ELSE IF( ldb.LT.max( 1, n ) )
THEN
490 ELSE IF( ldy.LT.max( 1, n ) )
THEN
494 CALL xerbla(
'CLA_SYRFSX_EXTENDED', -info )
497 eps = slamch(
'Epsilon' )
498 hugeval = slamch(
'Overflow' )
500 hugeval = hugeval * hugeval
502 incr_thresh = real( n ) * eps
504 IF ( lsame( uplo,
'L' ) )
THEN
505 uplo2 = ilauplo(
'L' )
507 uplo2 = ilauplo(
'U' )
511 y_prec_state = extra_residual
512 IF ( y_prec_state .EQ. extra_y )
THEN
529 x_state = working_state
530 z_state = unstable_state
538 CALL ccopy( n, b( 1, j ), 1, res, 1 )
539 IF ( y_prec_state .EQ. base_residual )
THEN
540 CALL csymv( uplo, n, cmplx(-1.0), a, lda, y(1,j), 1,
541 $ cmplx(1.0), res, 1 )
542 ELSE IF ( y_prec_state .EQ. extra_residual )
THEN
543 CALL blas_csymv_x( uplo2, n, cmplx(-1.0), a, lda,
544 $ y( 1, j ), 1, cmplx(1.0), res, 1, prec_type )
546 CALL blas_csymv2_x(uplo2, n, cmplx(-1.0), a, lda,
547 $ y(1, j), y_tail, 1, cmplx(1.0), res, 1, prec_type)
551 CALL ccopy( n, res, 1, dy, 1 )
552 CALL csytrs( uplo, n, 1, af, ldaf, ipiv, dy, n, info )
563 yk = cabs1( y( i, j ) )
564 dyk = cabs1( dy( i ) )
566 IF ( yk .NE. 0.0 )
THEN
567 dz_z = max( dz_z, dyk / yk )
568 ELSE IF ( dyk .NE. 0.0 )
THEN
572 ymin = min( ymin, yk )
574 normy = max( normy, yk )
577 normx = max( normx, yk * c( i ) )
578 normdx = max( normdx, dyk * c( i ) )
581 normdx = max( normdx, dyk )
585 IF ( normx .NE. 0.0 )
THEN
586 dx_x = normdx / normx
587 ELSE IF ( normdx .EQ. 0.0 )
THEN
593 dxrat = normdx / prevnormdx
594 dzrat = dz_z / prev_dz_z
598 IF ( ymin*rcond .LT. incr_thresh*normy
599 $ .AND. y_prec_state .LT. extra_y )
602 IF ( x_state .EQ. noprog_state .AND. dxrat .LE. rthresh )
603 $ x_state = working_state
604 IF ( x_state .EQ. working_state )
THEN
605 IF ( dx_x .LE. eps )
THEN
607 ELSE IF ( dxrat .GT. rthresh )
THEN
608 IF ( y_prec_state .NE. extra_y )
THEN
611 x_state = noprog_state
614 IF (dxrat .GT. dxratmax) dxratmax = dxrat
616 IF ( x_state .GT. working_state ) final_dx_x = dx_x
619 IF ( z_state .EQ. unstable_state .AND. dz_z .LE. dz_ub )
620 $ z_state = working_state
621 IF ( z_state .EQ. noprog_state .AND. dzrat .LE. rthresh )
622 $ z_state = working_state
623 IF ( z_state .EQ. working_state )
THEN
624 IF ( dz_z .LE. eps )
THEN
626 ELSE IF ( dz_z .GT. dz_ub )
THEN
627 z_state = unstable_state
630 ELSE IF ( dzrat .GT. rthresh )
THEN
631 IF ( y_prec_state .NE. extra_y )
THEN
634 z_state = noprog_state
637 IF ( dzrat .GT. dzratmax ) dzratmax = dzrat
639 IF ( z_state .GT. working_state ) final_dz_z = dz_z
642 IF ( x_state.NE.working_state.AND.
643 $ ( ignore_cwise.OR.z_state.NE.working_state ) )
646 IF ( incr_prec )
THEN
648 y_prec_state = y_prec_state + 1
659 IF ( y_prec_state .LT. extra_y )
THEN
660 CALL caxpy( n, cmplx(1.0), dy, 1, y(1,j), 1 )
671 IF ( x_state .EQ. working_state ) final_dx_x = dx_x
672 IF ( z_state .EQ. working_state ) final_dz_z = dz_z
676 IF ( n_norms .GE. 1 )
THEN
677 err_bnds_norm( j, la_linrx_err_i ) =
678 $ final_dx_x / (1 - dxratmax)
680 IF ( n_norms .GE. 2 )
THEN
681 err_bnds_comp( j, la_linrx_err_i ) =
682 $ final_dz_z / (1 - dzratmax)
693 CALL ccopy( n, b( 1, j ), 1, res, 1 )
694 CALL csymv( uplo, n, cmplx(-1.0), a, lda, y(1,j), 1,
695 $ cmplx(1.0), res, 1 )
698 ayb( i ) = cabs1( b( i, j ) )
704 $ a, lda, y(1, j), 1, 1.0, ayb, 1 )
subroutine xerbla(srname, info)
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine csymv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
CSYMV computes a matrix-vector product for a complex symmetric matrix.
subroutine csytrs(uplo, n, nrhs, a, lda, ipiv, b, ldb, info)
CSYTRS
subroutine cla_syamv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
CLA_SYAMV computes a matrix-vector product using a symmetric indefinite matrix to calculate error bou...
subroutine cla_syrfsx_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_SYRFSX_EXTENDED improves the computed solution to a system of linear equations for symmetric inde...
subroutine cla_lin_berr(n, nz, nrhs, res, ayb, berr)
CLA_LIN_BERR computes a component-wise relative backward error.
subroutine cla_wwaddw(n, x, y, w)
CLA_WWADDW adds a vector into a doubled-single vector.