390 SUBROUTINE dporfsx( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, S, B,
391 $ LDB, X, LDX, RCOND, BERR, N_ERR_BNDS,
392 $ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS,
393 $ WORK, IWORK, INFO )
400 CHARACTER UPLO, EQUED
401 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS, NPARAMS,
403 DOUBLE PRECISION RCOND
407 DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
408 $ X( LDX, * ), WORK( * )
409 DOUBLE PRECISION S( * ), PARAMS( * ), BERR( * ),
410 $ err_bnds_norm( nrhs, * ),
411 $ err_bnds_comp( nrhs, * )
417 DOUBLE PRECISION ZERO, ONE
418 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
419 DOUBLE PRECISION ITREF_DEFAULT, ITHRESH_DEFAULT
420 DOUBLE PRECISION COMPONENTWISE_DEFAULT, RTHRESH_DEFAULT
421 DOUBLE PRECISION DZTHRESH_DEFAULT
422 parameter( itref_default = 1.0d+0 )
423 parameter( ithresh_default = 10.0d+0 )
424 parameter( componentwise_default = 1.0d+0 )
425 parameter( rthresh_default = 0.5d+0 )
426 parameter( dzthresh_default = 0.25d+0 )
427 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
429 parameter( la_linrx_itref_i = 1,
430 $ la_linrx_ithresh_i = 2 )
431 parameter( la_linrx_cwise_i = 3 )
432 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
434 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
435 parameter( la_linrx_rcond_i = 3 )
440 INTEGER J, PREC_TYPE, REF_TYPE
442 DOUBLE PRECISION ANORM, RCOND_TMP
443 DOUBLE PRECISION ILLRCOND_THRESH, ERR_LBND, CWISE_WRONG
446 DOUBLE PRECISION RTHRESH, UNSTABLE_THRESH
457 DOUBLE PRECISION DLAMCH, DLANSY, DLA_PORCOND
466 ref_type = int( itref_default )
467 IF ( nparams .GE. la_linrx_itref_i )
THEN
468 IF ( params( la_linrx_itref_i ) .LT. 0.0d+0 )
THEN
469 params( la_linrx_itref_i ) = itref_default
471 ref_type = params( la_linrx_itref_i )
477 illrcond_thresh = dble( n ) * dlamch(
'Epsilon' )
478 ithresh = int( ithresh_default )
479 rthresh = rthresh_default
480 unstable_thresh = dzthresh_default
481 ignore_cwise = componentwise_default .EQ. 0.0d+0
483 IF ( nparams.GE.la_linrx_ithresh_i )
THEN
484 IF ( params( la_linrx_ithresh_i ).LT.0.0d+0 )
THEN
485 params( la_linrx_ithresh_i ) = ithresh
487 ithresh = int( params( la_linrx_ithresh_i ) )
490 IF ( nparams.GE.la_linrx_cwise_i )
THEN
491 IF ( params( la_linrx_cwise_i ).LT.0.0d+0 )
THEN
492 IF ( ignore_cwise )
THEN
493 params( la_linrx_cwise_i ) = 0.0d+0
495 params( la_linrx_cwise_i ) = 1.0d+0
498 ignore_cwise = params( la_linrx_cwise_i ) .EQ. 0.0d+0
501 IF ( ref_type .EQ. 0 .OR. n_err_bnds .EQ. 0 )
THEN
503 ELSE IF ( ignore_cwise )
THEN
509 rcequ = lsame( equed,
'Y' )
513 IF (.NOT.lsame(uplo,
'U') .AND. .NOT.lsame(uplo,
'L'))
THEN
515 ELSE IF( .NOT.rcequ .AND. .NOT.lsame( equed,
'N' ) )
THEN
517 ELSE IF( n.LT.0 )
THEN
519 ELSE IF( nrhs.LT.0 )
THEN
521 ELSE IF( lda.LT.max( 1, n ) )
THEN
523 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
525 ELSE IF( ldb.LT.max( 1, n ) )
THEN
527 ELSE IF( ldx.LT.max( 1, n ) )
THEN
531 CALL xerbla(
'DPORFSX', -info )
537 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
541 IF ( n_err_bnds .GE. 1 )
THEN
542 err_bnds_norm( j, la_linrx_trust_i ) = 1.0d+0
543 err_bnds_comp( j, la_linrx_trust_i ) = 1.0d+0
545 IF ( n_err_bnds .GE. 2 )
THEN
546 err_bnds_norm( j, la_linrx_err_i ) = 0.0d+0
547 err_bnds_comp( j, la_linrx_err_i ) = 0.0d+0
549 IF ( n_err_bnds .GE. 3 )
THEN
550 err_bnds_norm( j, la_linrx_rcond_i ) = 1.0d+0
551 err_bnds_comp( j, la_linrx_rcond_i ) = 1.0d+0
562 IF ( n_err_bnds .GE. 1 )
THEN
563 err_bnds_norm( j, la_linrx_trust_i ) = 1.0d+0
564 err_bnds_comp( j, la_linrx_trust_i ) = 1.0d+0
566 IF ( n_err_bnds .GE. 2 )
THEN
567 err_bnds_norm( j, la_linrx_err_i ) = 1.0d+0
568 err_bnds_comp( j, la_linrx_err_i ) = 1.0d+0
570 IF ( n_err_bnds .GE. 3 )
THEN
571 err_bnds_norm( j, la_linrx_rcond_i ) = 0.0d+0
572 err_bnds_comp( j, la_linrx_rcond_i ) = 0.0d+0
580 anorm = dlansy( norm, uplo, n, a, lda, work )
581 CALL dpocon( uplo, n, af, ldaf, anorm, rcond, work,
586 IF ( ref_type .NE. 0 )
THEN
588 prec_type = ilaprec(
'E' )
591 $ nrhs, a, lda, af, ldaf, rcequ, s, b,
592 $ ldb, x, ldx, berr, n_norms, err_bnds_norm, err_bnds_comp,
593 $ work( n+1 ), work( 1 ), work( 2*n+1 ), work( 1 ), rcond,
594 $ ithresh, rthresh, unstable_thresh, ignore_cwise,
598 err_lbnd = max( 10.0d+0, 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
subroutine xerbla(srname, info)
integer function ilaprec(prec)
ILAPREC
double precision function dla_porcond(uplo, n, a, lda, af, ldaf, cmode, c, info, work, iwork)
DLA_PORCOND estimates the Skeel condition number for a symmetric positive-definite matrix.
subroutine dla_porfsx_extended(prec_type, uplo, n, nrhs, a, lda, af, ldaf, 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)
DLA_PORFSX_EXTENDED improves the computed solution to a system of linear equations for symmetric or H...
double precision function dlamch(cmach)
DLAMCH
double precision function dlansy(norm, uplo, n, a, lda, work)
DLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
logical function lsame(ca, cb)
LSAME
subroutine dpocon(uplo, n, a, lda, anorm, rcond, work, iwork, info)
DPOCON
subroutine dporfsx(uplo, equed, n, nrhs, a, lda, af, ldaf, s, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, iwork, info)
DPORFSX