388 SUBROUTINE dporfsx( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, S,
390 $ LDB, X, LDX, RCOND, BERR, N_ERR_BNDS,
391 $ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS,
392 $ WORK, IWORK, INFO )
399 CHARACTER UPLO, EQUED
400 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS, NPARAMS,
402 DOUBLE PRECISION RCOND
406 DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
407 $ X( LDX, * ), WORK( * )
408 DOUBLE PRECISION S( * ), PARAMS( * ), BERR( * ),
409 $ err_bnds_norm( nrhs, * ),
410 $ err_bnds_comp( nrhs, * )
416 DOUBLE PRECISION ZERO, ONE
417 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
418 DOUBLE PRECISION ITREF_DEFAULT, ITHRESH_DEFAULT
419 DOUBLE PRECISION COMPONENTWISE_DEFAULT, RTHRESH_DEFAULT
420 DOUBLE PRECISION DZTHRESH_DEFAULT
421 parameter( itref_default = 1.0d+0 )
422 parameter( ithresh_default = 10.0d+0 )
423 parameter( componentwise_default = 1.0d+0 )
424 parameter( rthresh_default = 0.5d+0 )
425 parameter( dzthresh_default = 0.25d+0 )
426 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
428 parameter( la_linrx_itref_i = 1,
429 $ la_linrx_ithresh_i = 2 )
430 parameter( la_linrx_cwise_i = 3 )
431 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
433 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
434 parameter( la_linrx_rcond_i = 3 )
439 INTEGER J, PREC_TYPE, REF_TYPE
441 DOUBLE PRECISION ANORM, RCOND_TMP
442 DOUBLE PRECISION ILLRCOND_THRESH, ERR_LBND, CWISE_WRONG
445 DOUBLE PRECISION RTHRESH, UNSTABLE_THRESH
456 DOUBLE PRECISION DLAMCH, DLANSY, DLA_PORCOND
465 ref_type = int( itref_default )
466 IF ( nparams .GE. la_linrx_itref_i )
THEN
467 IF ( params( la_linrx_itref_i ) .LT. 0.0d+0 )
THEN
468 params( la_linrx_itref_i ) = itref_default
470 ref_type = params( la_linrx_itref_i )
476 illrcond_thresh = dble( n ) * dlamch(
'Epsilon' )
477 ithresh = int( ithresh_default )
478 rthresh = rthresh_default
479 unstable_thresh = dzthresh_default
480 ignore_cwise = componentwise_default .EQ. 0.0d+0
482 IF ( nparams.GE.la_linrx_ithresh_i )
THEN
483 IF ( params( la_linrx_ithresh_i ).LT.0.0d+0 )
THEN
484 params( la_linrx_ithresh_i ) = ithresh
486 ithresh = int( params( la_linrx_ithresh_i ) )
489 IF ( nparams.GE.la_linrx_cwise_i )
THEN
490 IF ( params( la_linrx_cwise_i ).LT.0.0d+0 )
THEN
491 IF ( ignore_cwise )
THEN
492 params( la_linrx_cwise_i ) = 0.0d+0
494 params( la_linrx_cwise_i ) = 1.0d+0
497 ignore_cwise = params( la_linrx_cwise_i ) .EQ. 0.0d+0
500 IF ( ref_type .EQ. 0 .OR. n_err_bnds .EQ. 0 )
THEN
502 ELSE IF ( ignore_cwise )
THEN
508 rcequ = lsame( equed,
'Y' )
512 IF (.NOT.lsame(uplo,
'U') .AND. .NOT.lsame(uplo,
'L'))
THEN
514 ELSE IF( .NOT.rcequ .AND. .NOT.lsame( equed,
'N' ) )
THEN
516 ELSE IF( n.LT.0 )
THEN
518 ELSE IF( nrhs.LT.0 )
THEN
520 ELSE IF( lda.LT.max( 1, n ) )
THEN
522 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
524 ELSE IF( ldb.LT.max( 1, n ) )
THEN
526 ELSE IF( ldx.LT.max( 1, n ) )
THEN
530 CALL xerbla(
'DPORFSX', -info )
536 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
540 IF ( n_err_bnds .GE. 1 )
THEN
541 err_bnds_norm( j, la_linrx_trust_i ) = 1.0d+0
542 err_bnds_comp( j, la_linrx_trust_i ) = 1.0d+0
544 IF ( n_err_bnds .GE. 2 )
THEN
545 err_bnds_norm( j, la_linrx_err_i ) = 0.0d+0
546 err_bnds_comp( j, la_linrx_err_i ) = 0.0d+0
548 IF ( n_err_bnds .GE. 3 )
THEN
549 err_bnds_norm( j, la_linrx_rcond_i ) = 1.0d+0
550 err_bnds_comp( j, la_linrx_rcond_i ) = 1.0d+0
561 IF ( n_err_bnds .GE. 1 )
THEN
562 err_bnds_norm( j, la_linrx_trust_i ) = 1.0d+0
563 err_bnds_comp( j, la_linrx_trust_i ) = 1.0d+0
565 IF ( n_err_bnds .GE. 2 )
THEN
566 err_bnds_norm( j, la_linrx_err_i ) = 1.0d+0
567 err_bnds_comp( j, la_linrx_err_i ) = 1.0d+0
569 IF ( n_err_bnds .GE. 3 )
THEN
570 err_bnds_norm( j, la_linrx_rcond_i ) = 0.0d+0
571 err_bnds_comp( j, la_linrx_rcond_i ) = 0.0d+0
579 anorm = dlansy( norm, uplo, n, a, lda, work )
580 CALL dpocon( uplo, n, af, ldaf, anorm, rcond, work,
585 IF ( ref_type .NE. 0 )
THEN
587 prec_type = ilaprec(
'E' )
590 $ nrhs, a, lda, af, ldaf, rcequ, s, b,
591 $ ldb, x, ldx, berr, n_norms, err_bnds_norm, err_bnds_comp,
592 $ work( n+1 ), work( 1 ), work( 2*n+1 ), work( 1 ), rcond,
593 $ ithresh, rthresh, unstable_thresh, ignore_cwise,
597 err_lbnd = max( 10.0d+0,
598 $ sqrt( dble( n ) ) ) * dlamch(
'Epsilon' )
599 IF ( n_err_bnds .GE. 1 .AND. n_norms .GE. 1 )
THEN
604 rcond_tmp = dla_porcond( uplo, n, a, lda, af, ldaf,
605 $ -1, s, info, work, iwork )
607 rcond_tmp = dla_porcond( uplo, n, a, lda, af, ldaf,
608 $ 0, s, info, work, iwork )
614 IF ( n_err_bnds .GE. la_linrx_err_i
615 $ .AND. err_bnds_norm( j, la_linrx_err_i ) .GT. 1.0d+0 )
616 $ err_bnds_norm( j, la_linrx_err_i ) = 1.0d+0
620 IF ( rcond_tmp .LT. illrcond_thresh )
THEN
621 err_bnds_norm( j, la_linrx_err_i ) = 1.0d+0
622 err_bnds_norm( j, la_linrx_trust_i ) = 0.0d+0
623 IF ( info .LE. n ) info = n + j
624 ELSE IF ( err_bnds_norm( j, la_linrx_err_i ) .LT. err_lbnd )
626 err_bnds_norm( j, la_linrx_err_i ) = err_lbnd
627 err_bnds_norm( j, la_linrx_trust_i ) = 1.0d+0
632 IF (n_err_bnds .GE. la_linrx_rcond_i)
THEN
633 err_bnds_norm( j, la_linrx_rcond_i ) = rcond_tmp
638 IF ( n_err_bnds .GE. 1 .AND. n_norms .GE. 2 )
THEN
648 cwise_wrong = sqrt( dlamch(
'Epsilon' ) )
650 IF (err_bnds_comp( j, la_linrx_err_i ) .LT. cwise_wrong )
652 rcond_tmp = dla_porcond( uplo, n, a, lda, af, ldaf, 1,
653 $ x( 1, j ), info, work, iwork )
660 IF ( n_err_bnds .GE. la_linrx_err_i
661 $ .AND. err_bnds_comp( j, la_linrx_err_i ) .GT. 1.0d+0 )
662 $ err_bnds_comp( j, la_linrx_err_i ) = 1.0d+0
666 IF ( rcond_tmp .LT. illrcond_thresh )
THEN
667 err_bnds_comp( j, la_linrx_err_i ) = 1.0d+0
668 err_bnds_comp( j, la_linrx_trust_i ) = 0.0d+0
669 IF ( params( la_linrx_cwise_i ) .EQ. 1.0d+0
670 $ .AND. info.LT.n + j ) info = n + j
671 ELSE IF ( err_bnds_comp( j, la_linrx_err_i )
672 $ .LT. err_lbnd )
THEN
673 err_bnds_comp( j, la_linrx_err_i ) = err_lbnd
674 err_bnds_comp( j, la_linrx_trust_i ) = 1.0d+0
679 IF ( n_err_bnds .GE. la_linrx_rcond_i )
THEN
680 err_bnds_comp( j, la_linrx_rcond_i ) = rcond_tmp