396 SUBROUTINE ssyrfsx( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF,
398 $ S, B, LDB, X, LDX, RCOND, BERR, N_ERR_BNDS,
399 $ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS,
400 $ WORK, IWORK, INFO )
407 CHARACTER UPLO, EQUED
408 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS, NPARAMS,
413 INTEGER IPIV( * ), IWORK( * )
414 REAL A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
415 $ X( LDX, * ), WORK( * )
416 REAL S( * ), PARAMS( * ), BERR( * ),
417 $ err_bnds_norm( nrhs, * ),
418 $ err_bnds_comp( nrhs, * )
425 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
426 REAL ITREF_DEFAULT, ITHRESH_DEFAULT,
427 $ COMPONENTWISE_DEFAULT
428 REAL RTHRESH_DEFAULT, DZTHRESH_DEFAULT
429 parameter( itref_default = 1.0 )
430 parameter( ithresh_default = 10.0 )
431 parameter( componentwise_default = 1.0 )
432 parameter( rthresh_default = 0.5 )
433 parameter( dzthresh_default = 0.25 )
434 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
436 parameter( la_linrx_itref_i = 1,
437 $ la_linrx_ithresh_i = 2 )
438 parameter( la_linrx_cwise_i = 3 )
439 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
441 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
442 parameter( la_linrx_rcond_i = 3 )
447 INTEGER J, PREC_TYPE, REF_TYPE, N_NORMS
448 REAL ANORM, RCOND_TMP
449 REAL ILLRCOND_THRESH, ERR_LBND, CWISE_WRONG
452 REAL RTHRESH, UNSTABLE_THRESH
463 REAL SLAMCH, SLANSY, SLA_SYRCOND
472 ref_type = int( itref_default )
473 IF ( nparams .GE. la_linrx_itref_i )
THEN
474 IF ( params( la_linrx_itref_i ) .LT. 0.0 )
THEN
475 params( la_linrx_itref_i ) = itref_default
477 ref_type = params( la_linrx_itref_i )
483 illrcond_thresh = real( n )*slamch(
'Epsilon' )
484 ithresh = int( ithresh_default )
485 rthresh = rthresh_default
486 unstable_thresh = dzthresh_default
487 ignore_cwise = componentwise_default .EQ. 0.0
489 IF ( nparams.GE.la_linrx_ithresh_i )
THEN
490 IF ( params( la_linrx_ithresh_i ).LT.0.0 )
THEN
491 params( la_linrx_ithresh_i ) = ithresh
493 ithresh = int( params( la_linrx_ithresh_i ) )
496 IF ( nparams.GE.la_linrx_cwise_i )
THEN
497 IF ( params( la_linrx_cwise_i ).LT.0.0 )
THEN
498 IF ( ignore_cwise )
THEN
499 params( la_linrx_cwise_i ) = 0.0
501 params( la_linrx_cwise_i ) = 1.0
504 ignore_cwise = params( la_linrx_cwise_i ) .EQ. 0.0
507 IF ( ref_type .EQ. 0 .OR. n_err_bnds .EQ. 0 )
THEN
509 ELSE IF ( ignore_cwise )
THEN
515 rcequ = lsame( equed,
'Y' )
519 IF ( .NOT.lsame( uplo,
'U' ) .AND.
520 $ .NOT.lsame( uplo,
'L' ) )
THEN
522 ELSE IF( .NOT.rcequ .AND. .NOT.lsame( equed,
'N' ) )
THEN
524 ELSE IF( n.LT.0 )
THEN
526 ELSE IF( nrhs.LT.0 )
THEN
528 ELSE IF( lda.LT.max( 1, n ) )
THEN
530 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
532 ELSE IF( ldb.LT.max( 1, n ) )
THEN
534 ELSE IF( ldx.LT.max( 1, n ) )
THEN
538 CALL xerbla(
'SSYRFSX', -info )
544 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
548 IF ( n_err_bnds .GE. 1 )
THEN
549 err_bnds_norm( j, la_linrx_trust_i ) = 1.0
550 err_bnds_comp( j, la_linrx_trust_i ) = 1.0
552 IF ( n_err_bnds .GE. 2 )
THEN
553 err_bnds_norm( j, la_linrx_err_i ) = 0.0
554 err_bnds_comp( j, la_linrx_err_i ) = 0.0
556 IF ( n_err_bnds .GE. 3 )
THEN
557 err_bnds_norm( j, la_linrx_rcond_i ) = 1.0
558 err_bnds_comp( j, la_linrx_rcond_i ) = 1.0
569 IF ( n_err_bnds .GE. 1 )
THEN
570 err_bnds_norm( j, la_linrx_trust_i ) = 1.0
571 err_bnds_comp( j, la_linrx_trust_i ) = 1.0
573 IF ( n_err_bnds .GE. 2 )
THEN
574 err_bnds_norm( j, la_linrx_err_i ) = 1.0
575 err_bnds_comp( j, la_linrx_err_i ) = 1.0
577 IF ( n_err_bnds .GE. 3 )
THEN
578 err_bnds_norm( j, la_linrx_rcond_i ) = 0.0
579 err_bnds_comp( j, la_linrx_rcond_i ) = 0.0
587 anorm = slansy( norm, uplo, n, a, lda, work )
588 CALL ssycon( uplo, n, af, ldaf, ipiv, anorm, rcond, work,
593 IF ( ref_type .NE. 0 )
THEN
595 prec_type = ilaprec(
'D' )
598 $ nrhs, a, lda, af, ldaf, ipiv, rcequ, s, b,
599 $ ldb, x, ldx, berr, n_norms, err_bnds_norm, err_bnds_comp,
600 $ work( n+1 ), work( 1 ), work( 2*n+1 ), work( 1 ), rcond,
601 $ ithresh, rthresh, unstable_thresh, ignore_cwise,
605 err_lbnd = max( 10.0, sqrt( real( n ) ) )*slamch(
'Epsilon' )
606 IF (n_err_bnds .GE. 1 .AND. n_norms .GE. 1)
THEN
611 rcond_tmp = sla_syrcond( uplo, n, a, lda, af, ldaf, ipiv,
612 $ -1, s, info, work, iwork )
614 rcond_tmp = sla_syrcond( uplo, n, a, lda, af, ldaf, ipiv,
615 $ 0, s, info, work, iwork )
621 IF (n_err_bnds .GE. la_linrx_err_i
622 $ .AND. err_bnds_norm( j, la_linrx_err_i ) .GT. 1.0)
623 $ err_bnds_norm( j, la_linrx_err_i ) = 1.0
627 IF ( rcond_tmp .LT. illrcond_thresh )
THEN
628 err_bnds_norm( j, la_linrx_err_i ) = 1.0
629 err_bnds_norm( j, la_linrx_trust_i ) = 0.0
630 IF ( info .LE. n ) info = n + j
631 ELSE IF (err_bnds_norm( j, la_linrx_err_i ) .LT. err_lbnd)
633 err_bnds_norm( j, la_linrx_err_i ) = err_lbnd
634 err_bnds_norm( j, la_linrx_trust_i ) = 1.0
639 IF (n_err_bnds .GE. la_linrx_rcond_i)
THEN
640 err_bnds_norm( j, la_linrx_rcond_i ) = rcond_tmp
645 IF ( n_err_bnds .GE. 1 .AND. n_norms .GE. 2 )
THEN
655 cwise_wrong = sqrt( slamch(
'Epsilon' ) )
657 IF ( err_bnds_comp( j, la_linrx_err_i ) .LT. cwise_wrong )
659 rcond_tmp = sla_syrcond( uplo, n, a, lda, af, ldaf,
661 $ 1, x(1,j), info, work, iwork )
668 IF ( n_err_bnds .GE. la_linrx_err_i
669 $ .AND. err_bnds_comp( j, la_linrx_err_i ) .GT. 1.0 )
670 $ err_bnds_comp( j, la_linrx_err_i ) = 1.0
674 IF ( rcond_tmp .LT. illrcond_thresh )
THEN
675 err_bnds_comp( j, la_linrx_err_i ) = 1.0
676 err_bnds_comp( j, la_linrx_trust_i ) = 0.0
677 IF ( .NOT. ignore_cwise
678 $ .AND. info.LT.n + j ) info = n + j
679 ELSE IF ( err_bnds_comp( j, la_linrx_err_i )
680 $ .LT. err_lbnd )
THEN
681 err_bnds_comp( j, la_linrx_err_i ) = err_lbnd
682 err_bnds_comp( j, la_linrx_trust_i ) = 1.0
687 IF ( n_err_bnds .GE. la_linrx_rcond_i )
THEN
688 err_bnds_comp( j, la_linrx_rcond_i ) = rcond_tmp