387 SUBROUTINE cporfsx( 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,
404 COMPLEX A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
405 $ x( ldx, * ), work( * )
406 REAL RWORK( * ), S( * ), PARAMS(*), BERR( * ),
407 $ ERR_BNDS_NORM( NRHS, * ),
408 $ err_bnds_comp( nrhs, * )
415 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
416 REAL ITREF_DEFAULT, ITHRESH_DEFAULT,
417 $ COMPONENTWISE_DEFAULT
418 REAL RTHRESH_DEFAULT, DZTHRESH_DEFAULT
419 parameter( itref_default = 1.0 )
420 parameter( ithresh_default = 10.0 )
421 parameter( componentwise_default = 1.0 )
422 parameter( rthresh_default = 0.5 )
423 parameter( dzthresh_default = 0.25 )
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 REAL ANORM, RCOND_TMP
440 REAL ILLRCOND_THRESH, ERR_LBND, CWISE_WRONG
443 REAL RTHRESH, UNSTABLE_THRESH
449 INTRINSIC max, sqrt, transfer
455 REAL SLAMCH, CLANHE, CLA_PORCOND_X, CLA_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.0 )
THEN
467 params( la_linrx_itref_i ) = itref_default
469 ref_type = params( la_linrx_itref_i )
475 illrcond_thresh = real( n ) * slamch(
'Epsilon' )
476 ithresh = int( ithresh_default )
477 rthresh = rthresh_default
478 unstable_thresh = dzthresh_default
479 ignore_cwise = componentwise_default .EQ. 0.0
481 IF ( nparams.GE.la_linrx_ithresh_i )
THEN
482 IF ( params(la_linrx_ithresh_i ).LT.0.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.0 )
THEN
490 IF ( ignore_cwise )
THEN
491 params( la_linrx_cwise_i ) = 0.0
493 params( la_linrx_cwise_i ) = 1.0
496 ignore_cwise = params( la_linrx_cwise_i ) .EQ. 0.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(
'CPORFSX', -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.0
542 err_bnds_comp( j, la_linrx_trust_i ) = 1.0
544 IF ( n_err_bnds .GE. 2 )
THEN
545 err_bnds_norm( j, la_linrx_err_i ) = 0.0
546 err_bnds_comp( j, la_linrx_err_i ) = 0.0
548 IF ( n_err_bnds .GE. 3 )
THEN
549 err_bnds_norm( j, la_linrx_rcond_i ) = 1.0
550 err_bnds_comp( j, la_linrx_rcond_i ) = 1.0
561 IF ( n_err_bnds .GE. 1 )
THEN
562 err_bnds_norm( j, la_linrx_trust_i ) = 1.0
563 err_bnds_comp( j, la_linrx_trust_i ) = 1.0
565 IF ( n_err_bnds .GE. 2 )
THEN
566 err_bnds_norm( j, la_linrx_err_i ) = 1.0
567 err_bnds_comp( j, la_linrx_err_i ) = 1.0
569 IF ( n_err_bnds .GE. 3 )
THEN
570 err_bnds_norm( j, la_linrx_rcond_i ) = 0.0
571 err_bnds_comp( j, la_linrx_rcond_i ) = 0.0
579 anorm = clanhe( norm, uplo, n, a, lda, rwork )
580 CALL cpocon( uplo, n, af, ldaf, anorm, rcond, work, rwork,
585 IF ( ref_type .NE. 0 )
THEN
587 prec_type = ilaprec(
'D' )
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.0, sqrt( real( n ) ) ) * slamch(
'Epsilon' )
599 IF ( n_err_bnds .GE. 1 .AND. n_norms .GE. 1 )
THEN
604 rcond_tmp = cla_porcond_c( uplo, n, a, lda, af, ldaf,
605 $ s, .true., info, work, rwork )
607 rcond_tmp = cla_porcond_c( uplo, n, a, lda, af, ldaf,
608 $ s, .false., info, work, rwork )
614 IF ( n_err_bnds .GE. la_linrx_err_i
615 $ .AND. err_bnds_norm( j, la_linrx_err_i ) .GT. 1.0 )
616 $ err_bnds_norm( j, la_linrx_err_i ) = 1.0
620 IF ( rcond_tmp .LT. illrcond_thresh )
THEN
621 err_bnds_norm( j, la_linrx_err_i ) = 1.0
622 err_bnds_norm( j, la_linrx_trust_i ) = 0.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.0
632 IF ( n_err_bnds .GE. la_linrx_rcond_i )
THEN
633 err_bnds_norm( j, la_linrx_rcond_i ) = rcond_tmp
639 IF (n_err_bnds .GE. 1 .AND. n_norms .GE. 2)
THEN
649 cwise_wrong = sqrt( slamch(
'Epsilon' ) )
651 IF (err_bnds_comp( j, la_linrx_err_i ) .LT. cwise_wrong )
653 rcond_tmp = cla_porcond_x( uplo, n, a, lda, af, ldaf,
654 $ x(1,j), info, work, rwork )
661 IF ( n_err_bnds .GE. la_linrx_err_i
662 $ .AND. err_bnds_comp( j, la_linrx_err_i ) .GT. 1.0 )
663 $ err_bnds_comp( j, la_linrx_err_i ) = 1.0
667 IF (rcond_tmp .LT. illrcond_thresh)
THEN
668 err_bnds_comp( j, la_linrx_err_i ) = 1.0
669 err_bnds_comp( j, la_linrx_trust_i ) = 0.0
670 IF ( params( la_linrx_cwise_i ) .EQ. 1.0
671 $ .AND. info.LT.n + j ) info = n + j
672 ELSE IF ( err_bnds_comp( j, la_linrx_err_i )
673 $ .LT. err_lbnd )
THEN
674 err_bnds_comp( j, la_linrx_err_i ) = err_lbnd
675 err_bnds_comp( j, la_linrx_trust_i ) = 1.0
680 IF ( n_err_bnds .GE. la_linrx_rcond_i )
THEN
681 err_bnds_comp( j, la_linrx_rcond_i ) = rcond_tmp