388 $ AF, LDAF, IPIV, COLEQU, C, B, LDB,
389 $ Y, LDY, BERR_OUT, N_NORMS,
390 $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES,
391 $ AYB, DY, Y_TAIL, RCOND, ITHRESH,
392 $ RTHRESH, DZ_UB, IGNORE_CWISE,
400 INTEGER INFO, LDA, LDAF, LDB, LDY, N, NRHS, PREC_TYPE,
403 LOGICAL COLEQU, IGNORE_CWISE
408 COMPLEX A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
409 $ y( ldy, * ), res( * ), dy( * ), y_tail( * )
410 REAL C( * ), AYB( * ), RCOND, BERR_OUT( * ),
411 $ err_bnds_norm( nrhs, * ),
412 $ err_bnds_comp( nrhs, * )
418 INTEGER UPLO2, CNT, I, J, X_STATE, Z_STATE,
420 REAL 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
424 LOGICAL INCR_PREC, UPPER
428 INTEGER UNSTABLE_STATE, WORKING_STATE, CONV_STATE,
429 $ NOPROG_STATE, BASE_RESIDUAL, EXTRA_RESIDUAL,
431 parameter( unstable_state = 0, working_state = 1,
432 $ conv_state = 2, noprog_state = 3 )
433 parameter( base_residual = 0, extra_residual = 1,
435 INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
436 INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
437 INTEGER CMP_ERR_I, PIV_GROWTH_I
438 parameter( final_nrm_err_i = 1, final_cmp_err_i = 2,
440 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
441 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
443 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
445 parameter( la_linrx_itref_i = 1,
446 $ la_linrx_ithresh_i = 2 )
447 parameter( la_linrx_cwise_i = 3 )
448 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
450 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
451 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 )