387 SUBROUTINE zporfsx( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, S,
389 $ LDB, X, LDX, RCOND, BERR, N_ERR_BNDS,
390 $ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS,
391 $ WORK, RWORK, INFO )
398 CHARACTER UPLO, EQUED
399 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS, NPARAMS,
401 DOUBLE PRECISION RCOND
404 COMPLEX*16 A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
405 $ x( ldx, * ), work( * )
406 DOUBLE PRECISION RWORK( * ), S( * ), PARAMS(*), BERR( * ),
407 $ ERR_BNDS_NORM( NRHS, * ),
408 $ err_bnds_comp( nrhs, * )
414 DOUBLE PRECISION ZERO, ONE
415 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
416 DOUBLE PRECISION ITREF_DEFAULT, ITHRESH_DEFAULT
417 DOUBLE PRECISION COMPONENTWISE_DEFAULT, RTHRESH_DEFAULT
418 DOUBLE PRECISION DZTHRESH_DEFAULT
419 parameter( itref_default = 1.0d+0 )
420 parameter( ithresh_default = 10.0d+0 )
421 parameter( componentwise_default = 1.0d+0 )
422 parameter( rthresh_default = 0.5d+0 )
423 parameter( dzthresh_default = 0.25d+0 )
424 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
426 parameter( la_linrx_itref_i = 1,
427 $ la_linrx_ithresh_i = 2 )
428 parameter( la_linrx_cwise_i = 3 )
429 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
431 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
432 parameter( la_linrx_rcond_i = 3 )
437 INTEGER J, PREC_TYPE, REF_TYPE
439 DOUBLE PRECISION ANORM, RCOND_TMP
440 DOUBLE PRECISION ILLRCOND_THRESH, ERR_LBND, CWISE_WRONG
443 DOUBLE PRECISION RTHRESH, UNSTABLE_THRESH
449 INTRINSIC max, sqrt, transfer
455 DOUBLE PRECISION DLAMCH, ZLANHE, ZLA_PORCOND_X, ZLA_PORCOND_C
464 ref_type = int( itref_default )
465 IF ( nparams .GE. la_linrx_itref_i )
THEN
466 IF ( params( la_linrx_itref_i ) .LT. 0.0d+0 )
THEN
467 params( la_linrx_itref_i ) = itref_default
469 ref_type = params( la_linrx_itref_i )
475 illrcond_thresh = dble( n ) * dlamch(
'Epsilon' )
476 ithresh = int( ithresh_default )
477 rthresh = rthresh_default
478 unstable_thresh = dzthresh_default
479 ignore_cwise = componentwise_default .EQ. 0.0d+0
481 IF ( nparams.GE.la_linrx_ithresh_i )
THEN
482 IF ( params(la_linrx_ithresh_i ).LT.0.0d+0 )
THEN
483 params( la_linrx_ithresh_i ) = ithresh
485 ithresh = int( params( la_linrx_ithresh_i ) )
488 IF ( nparams.GE.la_linrx_cwise_i )
THEN
489 IF ( params(la_linrx_cwise_i ).LT.0.0d+0 )
THEN
490 IF ( ignore_cwise )
THEN
491 params( la_linrx_cwise_i ) = 0.0d+0
493 params( la_linrx_cwise_i ) = 1.0d+0
496 ignore_cwise = params( la_linrx_cwise_i ) .EQ. 0.0d+0
499 IF ( ref_type .EQ. 0 .OR. n_err_bnds .EQ. 0 )
THEN
501 ELSE IF ( ignore_cwise )
THEN
507 rcequ = lsame( equed,
'Y' )
511 IF (.NOT.lsame( uplo,
'U' ) .AND.
512 $ .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(
'ZPORFSX', -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 = zlanhe( norm, uplo, n, a, lda, rwork )
580 CALL zpocon( uplo, n, af, ldaf, anorm, rcond, work, rwork,
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, rwork, work(n+1),
593 $ transfer(rwork(1:2*n), (/ (zero, zero) /), n), rcond,
594 $ ithresh, rthresh, unstable_thresh, ignore_cwise,
598 err_lbnd = max( 10.0d+0,
599 $ sqrt( dble( n ) ) ) * dlamch(
'Epsilon' )
600 IF ( n_err_bnds .GE. 1 .AND. n_norms .GE. 1 )
THEN
605 rcond_tmp = zla_porcond_c( uplo, n, a, lda, af, ldaf,
606 $ s, .true., info, work, rwork )
608 rcond_tmp = zla_porcond_c( uplo, n, a, lda, af, ldaf,
609 $ s, .false., info, work, rwork )
615 IF ( n_err_bnds .GE. la_linrx_err_i
616 $ .AND. err_bnds_norm( j, la_linrx_err_i ) .GT. 1.0d+0 )
617 $ err_bnds_norm( j, la_linrx_err_i ) = 1.0d+0
621 IF ( rcond_tmp .LT. illrcond_thresh )
THEN
622 err_bnds_norm( j, la_linrx_err_i ) = 1.0d+0
623 err_bnds_norm( j, la_linrx_trust_i ) = 0.0d+0
624 IF ( info .LE. n ) info = n + j
625 ELSE IF ( err_bnds_norm( j, la_linrx_err_i ) .LT. err_lbnd )
627 err_bnds_norm( j, la_linrx_err_i ) = err_lbnd
628 err_bnds_norm( j, la_linrx_trust_i ) = 1.0d+0
633 IF ( n_err_bnds .GE. la_linrx_rcond_i )
THEN
634 err_bnds_norm( j, la_linrx_rcond_i ) = rcond_tmp
640 IF (n_err_bnds .GE. 1 .AND. n_norms .GE. 2)
THEN
650 cwise_wrong = sqrt( dlamch(
'Epsilon' ) )
652 IF (err_bnds_comp( j, la_linrx_err_i ) .LT. cwise_wrong )
654 rcond_tmp = zla_porcond_x( uplo, n, a, lda, af, ldaf,
655 $ x(1,j), info, work, rwork )
662 IF ( n_err_bnds .GE. la_linrx_err_i
663 $ .AND. err_bnds_comp( j, la_linrx_err_i ) .GT. 1.0d+0 )
664 $ err_bnds_comp( j, la_linrx_err_i ) = 1.0d+0
668 IF (rcond_tmp .LT. illrcond_thresh)
THEN
669 err_bnds_comp( j, la_linrx_err_i ) = 1.0d+0
670 err_bnds_comp( j, la_linrx_trust_i ) = 0.0d+0
671 IF ( params( la_linrx_cwise_i ) .EQ. 1.0d+0
672 $ .AND. info.LT.n + j ) info = n + j
673 ELSE IF ( err_bnds_comp( j, la_linrx_err_i )
674 $ .LT. err_lbnd )
THEN
675 err_bnds_comp( j, la_linrx_err_i ) = err_lbnd
676 err_bnds_comp( j, la_linrx_trust_i ) = 1.0d+0
681 IF ( n_err_bnds .GE. la_linrx_rcond_i )
THEN
682 err_bnds_comp( j, la_linrx_rcond_i ) = rcond_tmp