391 SUBROUTINE zporfsx( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, S, B,
392 $ ldb, x, ldx, rcond, berr, n_err_bnds,
393 $ err_bnds_norm, err_bnds_comp, nparams, params,
394 $ work, rwork, info )
402 CHARACTER uplo, equed
403 INTEGER info, lda, ldaf, ldb, ldx, n, nrhs, nparams,
405 DOUBLE PRECISION rcond
408 COMPLEX*16 a( lda, * ), af( ldaf, * ), b( ldb, * ),
409 $ x( ldx, * ), work( * )
410 DOUBLE PRECISION rwork( * ), s( * ), params(*), berr( * ),
411 $ err_bnds_norm( nrhs, * ),
412 $ err_bnds_comp( nrhs, * )
418 DOUBLE PRECISION zero, one
419 parameter( zero = 0.0d+0, one = 1.0d+0 )
420 DOUBLE PRECISION itref_default, ithresh_default
421 DOUBLE PRECISION componentwise_default, rthresh_default
422 DOUBLE PRECISION dzthresh_default
423 parameter( itref_default = 1.0d+0 )
424 parameter( ithresh_default = 10.0d+0 )
425 parameter( componentwise_default = 1.0d+0 )
426 parameter( rthresh_default = 0.5d+0 )
427 parameter( dzthresh_default = 0.25d+0 )
428 INTEGER la_linrx_itref_i, la_linrx_ithresh_i,
430 parameter( la_linrx_itref_i = 1,
431 $ la_linrx_ithresh_i = 2 )
432 parameter( la_linrx_cwise_i = 3 )
433 INTEGER la_linrx_trust_i, la_linrx_err_i,
435 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
436 parameter( la_linrx_rcond_i = 3 )
441 INTEGER j, prec_type, ref_type
443 DOUBLE PRECISION anorm, rcond_tmp
444 DOUBLE PRECISION illrcond_thresh, err_lbnd, cwise_wrong
447 DOUBLE PRECISION rthresh, unstable_thresh
453 INTRINSIC max, sqrt, transfer
460 INTEGER blas_fpinfo_x
468 ref_type = int( itref_default )
469 IF ( nparams .GE. la_linrx_itref_i )
THEN
470 IF ( params( la_linrx_itref_i ) .LT. 0.0d+0 )
THEN
471 params( la_linrx_itref_i ) = itref_default
473 ref_type = params( la_linrx_itref_i )
479 illrcond_thresh = dble( n ) *
dlamch(
'Epsilon' )
480 ithresh = int( ithresh_default )
481 rthresh = rthresh_default
482 unstable_thresh = dzthresh_default
483 ignore_cwise = componentwise_default .EQ. 0.0d+0
485 IF ( nparams.GE.la_linrx_ithresh_i )
THEN
486 IF ( params(la_linrx_ithresh_i ).LT.0.0d+0 )
THEN
487 params( la_linrx_ithresh_i ) = ithresh
489 ithresh = int( params( la_linrx_ithresh_i ) )
492 IF ( nparams.GE.la_linrx_cwise_i )
THEN
493 IF ( params(la_linrx_cwise_i ).LT.0.0d+0 )
THEN
494 IF ( ignore_cwise )
THEN
495 params( la_linrx_cwise_i ) = 0.0d+0
497 params( la_linrx_cwise_i ) = 1.0d+0
500 ignore_cwise = params( la_linrx_cwise_i ) .EQ. 0.0d+0
503 IF ( ref_type .EQ. 0 .OR. n_err_bnds .EQ. 0 )
THEN
505 ELSE IF ( ignore_cwise )
THEN
511 rcequ =
lsame( equed,
'Y' )
515 IF (.NOT.
lsame( uplo,
'U' ) .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
517 ELSE IF( .NOT.rcequ .AND. .NOT.
lsame( equed,
'N' ) )
THEN
519 ELSE IF( n.LT.0 )
THEN
521 ELSE IF( nrhs.LT.0 )
THEN
523 ELSE IF( lda.LT.max( 1, n ) )
THEN
525 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
527 ELSE IF( ldb.LT.max( 1, n ) )
THEN
529 ELSE IF( ldx.LT.max( 1, n ) )
THEN
533 CALL
xerbla(
'ZPORFSX', -info )
539 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
543 IF ( n_err_bnds .GE. 1 )
THEN
544 err_bnds_norm( j, la_linrx_trust_i ) = 1.0d+0
545 err_bnds_comp( j, la_linrx_trust_i ) = 1.0d+0
547 IF ( n_err_bnds .GE. 2 )
THEN
548 err_bnds_norm( j, la_linrx_err_i ) = 0.0d+0
549 err_bnds_comp( j, la_linrx_err_i ) = 0.0d+0
551 IF ( n_err_bnds .GE. 3 )
THEN
552 err_bnds_norm( j, la_linrx_rcond_i ) = 1.0d+0
553 err_bnds_comp( j, la_linrx_rcond_i ) = 1.0d+0
564 IF ( n_err_bnds .GE. 1 )
THEN
565 err_bnds_norm( j, la_linrx_trust_i ) = 1.0d+0
566 err_bnds_comp( j, la_linrx_trust_i ) = 1.0d+0
568 IF ( n_err_bnds .GE. 2 )
THEN
569 err_bnds_norm( j, la_linrx_err_i ) = 1.0d+0
570 err_bnds_comp( j, la_linrx_err_i ) = 1.0d+0
572 IF ( n_err_bnds .GE. 3 )
THEN
573 err_bnds_norm( j, la_linrx_rcond_i ) = 0.0d+0
574 err_bnds_comp( j, la_linrx_rcond_i ) = 0.0d+0
582 anorm =
zlanhe( norm, uplo, n, a, lda, rwork )
583 CALL
zpocon( uplo, n, af, ldaf, anorm, rcond, work, rwork,
588 IF ( ref_type .NE. 0 )
THEN
593 $ nrhs, a, lda, af, ldaf, rcequ, s, b,
594 $ ldb, x, ldx, berr, n_norms, err_bnds_norm, err_bnds_comp,
595 $ work, rwork, work(n+1),
596 $ transfer(rwork(1:2*n), (/ (zero, zero) /), n), rcond,
597 $ ithresh, rthresh, unstable_thresh, ignore_cwise,
601 err_lbnd = max( 10.0d+0, sqrt( dble( n ) ) ) *
dlamch(
'Epsilon' )
602 IF ( n_err_bnds .GE. 1 .AND. n_norms .GE. 1 )
THEN
608 $ s, .true., info, work, rwork )
611 $ s, .false., info, work, rwork )
617 IF ( n_err_bnds .GE. la_linrx_err_i
618 $ .AND. err_bnds_norm( j, la_linrx_err_i ) .GT. 1.0d+0 )
619 $ err_bnds_norm( j, la_linrx_err_i ) = 1.0d+0
623 IF ( rcond_tmp .LT. illrcond_thresh )
THEN
624 err_bnds_norm( j, la_linrx_err_i ) = 1.0d+0
625 err_bnds_norm( j, la_linrx_trust_i ) = 0.0d+0
626 IF ( info .LE. n ) info = n + j
627 ELSE IF ( err_bnds_norm( j, la_linrx_err_i ) .LT. err_lbnd )
629 err_bnds_norm( j, la_linrx_err_i ) = err_lbnd
630 err_bnds_norm( j, la_linrx_trust_i ) = 1.0d+0
635 IF ( n_err_bnds .GE. la_linrx_rcond_i )
THEN
636 err_bnds_norm( j, la_linrx_rcond_i ) = rcond_tmp
642 IF (n_err_bnds .GE. 1 .AND. n_norms .GE. 2)
THEN
652 cwise_wrong = sqrt(
dlamch(
'Epsilon' ) )
654 IF (err_bnds_comp( j, la_linrx_err_i ) .LT. cwise_wrong )
657 $ x(1,j), info, work, rwork )
664 IF ( n_err_bnds .GE. la_linrx_err_i
665 $ .AND. err_bnds_comp( j, la_linrx_err_i ) .GT. 1.0d+0 )
666 $ err_bnds_comp( j, la_linrx_err_i ) = 1.0d+0
670 IF (rcond_tmp .LT. illrcond_thresh)
THEN
671 err_bnds_comp( j, la_linrx_err_i ) = 1.0d+0
672 err_bnds_comp( j, la_linrx_trust_i ) = 0.0d+0
673 IF ( params( la_linrx_cwise_i ) .EQ. 1.0d+0
674 $ .AND. info.LT.n + j ) info = n + j
675 ELSE IF ( err_bnds_comp( j, la_linrx_err_i )
676 $ .LT. err_lbnd )
THEN
677 err_bnds_comp( j, la_linrx_err_i ) = err_lbnd
678 err_bnds_comp( j, la_linrx_trust_i ) = 1.0d+0
683 IF ( n_err_bnds .GE. la_linrx_rcond_i )
THEN
684 err_bnds_comp( j, la_linrx_rcond_i ) = rcond_tmp