410 SUBROUTINE zgerfsx( TRANS, EQUED, N, NRHS, A, LDA, AF, LDAF, IPIV,
411 $ R, C, B, LDB, X, LDX, RCOND, BERR, N_ERR_BNDS,
412 $ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS,
413 $ WORK, RWORK, INFO )
420 CHARACTER TRANS, EQUED
421 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS, NPARAMS,
423 DOUBLE PRECISION RCOND
427 COMPLEX*16 A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
428 $ X( LDX , * ), WORK( * )
429 DOUBLE PRECISION R( * ), C( * ), PARAMS( * ), BERR( * ),
430 $ err_bnds_norm( nrhs, * ),
431 $ err_bnds_comp( nrhs, * ), rwork( * )
437 DOUBLE PRECISION ZERO, ONE
438 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
439 DOUBLE PRECISION ITREF_DEFAULT, ITHRESH_DEFAULT
440 DOUBLE PRECISION COMPONENTWISE_DEFAULT, RTHRESH_DEFAULT
441 DOUBLE PRECISION DZTHRESH_DEFAULT
442 parameter( itref_default = 1.0d+0 )
443 parameter( ithresh_default = 10.0d+0 )
444 parameter( componentwise_default = 1.0d+0 )
445 parameter( rthresh_default = 0.5d+0 )
446 parameter( dzthresh_default = 0.25d+0 )
447 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
449 parameter( la_linrx_itref_i = 1,
450 $ la_linrx_ithresh_i = 2 )
451 parameter( la_linrx_cwise_i = 3 )
452 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
454 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
455 parameter( la_linrx_rcond_i = 3 )
459 LOGICAL ROWEQU, COLEQU, NOTRAN
460 INTEGER J, TRANS_TYPE, PREC_TYPE, REF_TYPE
462 DOUBLE PRECISION ANORM, RCOND_TMP
463 DOUBLE PRECISION ILLRCOND_THRESH, ERR_LBND, CWISE_WRONG
466 DOUBLE PRECISION RTHRESH, UNSTABLE_THRESH
472 INTRINSIC max, sqrt, transfer
477 DOUBLE PRECISION DLAMCH, ZLANGE, ZLA_GERCOND_X, ZLA_GERCOND_C
479 INTEGER ILATRANS, ILAPREC
486 trans_type = ilatrans( trans )
487 ref_type = int( itref_default )
488 IF ( nparams .GE. la_linrx_itref_i )
THEN
489 IF ( params( la_linrx_itref_i ) .LT. 0.0d+0 )
THEN
490 params( la_linrx_itref_i ) = itref_default
492 ref_type = params( la_linrx_itref_i )
498 illrcond_thresh = dble( n ) * dlamch(
'Epsilon' )
499 ithresh = int( ithresh_default )
500 rthresh = rthresh_default
501 unstable_thresh = dzthresh_default
502 ignore_cwise = componentwise_default .EQ. 0.0d+0
504 IF ( nparams.GE.la_linrx_ithresh_i )
THEN
505 IF ( params( la_linrx_ithresh_i ).LT.0.0d+0 )
THEN
506 params(la_linrx_ithresh_i) = ithresh
508 ithresh = int( params( la_linrx_ithresh_i ) )
511 IF ( nparams.GE.la_linrx_cwise_i )
THEN
512 IF ( params( la_linrx_cwise_i ).LT.0.0d+0 )
THEN
513 IF ( ignore_cwise )
THEN
514 params( la_linrx_cwise_i ) = 0.0d+0
516 params( la_linrx_cwise_i ) = 1.0d+0
519 ignore_cwise = params( la_linrx_cwise_i ) .EQ. 0.0d+0
522 IF ( ref_type .EQ. 0 .OR. n_err_bnds .EQ. 0 )
THEN
524 ELSE IF ( ignore_cwise )
THEN
530 notran = lsame( trans,
'N' )
531 rowequ = lsame( equed,
'R' ) .OR. lsame( equed,
'B' )
532 colequ = lsame( equed,
'C' ) .OR. lsame( equed,
'B' )
536 IF( trans_type.EQ.-1 )
THEN
538 ELSE IF( .NOT.rowequ .AND. .NOT.colequ .AND.
539 $ .NOT.lsame( equed,
'N' ) )
THEN
541 ELSE IF( n.LT.0 )
THEN
543 ELSE IF( nrhs.LT.0 )
THEN
545 ELSE IF( lda.LT.max( 1, n ) )
THEN
547 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
549 ELSE IF( ldb.LT.max( 1, n ) )
THEN
551 ELSE IF( ldx.LT.max( 1, n ) )
THEN
555 CALL xerbla(
'ZGERFSX', -info )
561 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
565 IF ( n_err_bnds .GE. 1 )
THEN
566 err_bnds_norm( j, la_linrx_trust_i ) = 1.0d+0
567 err_bnds_comp( j, la_linrx_trust_i ) = 1.0d+0
569 IF ( n_err_bnds .GE. 2 )
THEN
570 err_bnds_norm( j, la_linrx_err_i ) = 0.0d+0
571 err_bnds_comp( j, la_linrx_err_i ) = 0.0d+0
573 IF ( n_err_bnds .GE. 3 )
THEN
574 err_bnds_norm( j, la_linrx_rcond_i ) = 1.0d+0
575 err_bnds_comp( j, la_linrx_rcond_i ) = 1.0d+0
586 IF ( n_err_bnds .GE. 1 )
THEN
587 err_bnds_norm( j, la_linrx_trust_i ) = 1.0d+0
588 err_bnds_comp( j, la_linrx_trust_i ) = 1.0d+0
590 IF ( n_err_bnds .GE. 2 )
THEN
591 err_bnds_norm( j, la_linrx_err_i ) = 1.0d+0
592 err_bnds_comp( j, la_linrx_err_i ) = 1.0d+0
594 IF ( n_err_bnds .GE. 3 )
THEN
595 err_bnds_norm( j, la_linrx_rcond_i ) = 0.0d+0
596 err_bnds_comp( j, la_linrx_rcond_i ) = 0.0d+0
608 anorm = zlange( norm, n, n, a, lda, rwork )
609 CALL zgecon( norm, n, af, ldaf, anorm, rcond, work, rwork, info )
613 IF ( ref_type .NE. 0 )
THEN
615 prec_type = ilaprec(
'E' )
619 $ nrhs, a, lda, af, ldaf, ipiv, colequ, c, b,
620 $ ldb, x, ldx, berr, n_norms, err_bnds_norm,
621 $ err_bnds_comp, work, rwork, work(n+1),
622 $ transfer(rwork(1:2*n), (/ (zero, zero) /), n),
623 $ rcond, ithresh, rthresh, unstable_thresh, ignore_cwise,
627 $ nrhs, a, lda, af, ldaf, ipiv, rowequ, r, b,
628 $ ldb, x, ldx, berr, n_norms, err_bnds_norm,
629 $ err_bnds_comp, work, rwork, work(n+1),
630 $ transfer(rwork(1:2*n), (/ (zero, zero) /), n),
631 $ rcond, ithresh, rthresh, unstable_thresh, ignore_cwise,
636 err_lbnd = max( 10.0d+0, sqrt( dble( n ) ) ) * dlamch(
'Epsilon' )
637 IF ( n_err_bnds .GE. 1 .AND. n_norms .GE. 1 )
THEN
641 IF ( colequ .AND. notran )
THEN
642 rcond_tmp = zla_gercond_c( trans, n, a, lda, af, ldaf, ipiv,
643 $ c, .true., info, work, rwork )
644 ELSE IF ( rowequ .AND. .NOT. notran )
THEN
645 rcond_tmp = zla_gercond_c( trans, n, a, lda, af, ldaf, ipiv,
646 $ r, .true., info, work, rwork )
648 rcond_tmp = zla_gercond_c( trans, n, a, lda, af, ldaf, ipiv,
649 $ c, .false., info, work, rwork )
655 IF ( n_err_bnds .GE. la_linrx_err_i
656 $ .AND. err_bnds_norm( j, la_linrx_err_i ) .GT. 1.0d+0 )
657 $ err_bnds_norm( j, la_linrx_err_i ) = 1.0d+0
661 IF ( rcond_tmp .LT. illrcond_thresh )
THEN
662 err_bnds_norm( j, la_linrx_err_i ) = 1.0d+0
663 err_bnds_norm( j, la_linrx_trust_i ) = 0.0d+0
664 IF ( info .LE. n ) info = n + j
665 ELSE IF (err_bnds_norm( j, la_linrx_err_i ) .LT. err_lbnd)
667 err_bnds_norm( j, la_linrx_err_i ) = err_lbnd
668 err_bnds_norm( j, la_linrx_trust_i ) = 1.0d+0
673 IF ( n_err_bnds .GE. la_linrx_rcond_i )
THEN
674 err_bnds_norm( j, la_linrx_rcond_i ) = rcond_tmp
679 IF ( n_err_bnds .GE. 1 .AND. n_norms .GE. 2 )
THEN
689 cwise_wrong = sqrt( dlamch(
'Epsilon' ) )
691 IF ( err_bnds_comp( j, la_linrx_err_i ) .LT. cwise_wrong )
693 rcond_tmp = zla_gercond_x( trans, n, a, lda, af, ldaf,
694 $ ipiv, x(1,j), info, work, rwork )
701 IF ( n_err_bnds .GE. la_linrx_err_i
702 $ .AND. err_bnds_comp( j, la_linrx_err_i ) .GT. 1.0d+0 )
703 $ err_bnds_comp( j, la_linrx_err_i ) = 1.0d+0
707 IF ( rcond_tmp .LT. illrcond_thresh )
THEN
708 err_bnds_comp( j, la_linrx_err_i ) = 1.0d+0
709 err_bnds_comp( j, la_linrx_trust_i ) = 0.0d+0
710 IF ( params( la_linrx_cwise_i ) .EQ. 1.0d+0
711 $ .AND. info.LT.n + j ) info = n + j
712 ELSE IF ( err_bnds_comp( j, la_linrx_err_i )
713 $ .LT. err_lbnd )
THEN
714 err_bnds_comp( j, la_linrx_err_i ) = err_lbnd
715 err_bnds_comp( j, la_linrx_trust_i ) = 1.0d+0
720 IF ( n_err_bnds .GE. la_linrx_rcond_i )
THEN
721 err_bnds_comp( j, la_linrx_rcond_i ) = rcond_tmp
subroutine xerbla(srname, info)
subroutine zgecon(norm, n, a, lda, anorm, rcond, work, rwork, info)
ZGECON
subroutine zgerfsx(trans, equed, n, nrhs, a, lda, af, ldaf, ipiv, r, c, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info)
ZGERFSX
integer function ilaprec(prec)
ILAPREC
integer function ilatrans(trans)
ILATRANS
double precision function zla_gercond_c(trans, n, a, lda, af, ldaf, ipiv, c, capply, info, work, rwork)
ZLA_GERCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for general matrices.
double precision function zla_gercond_x(trans, n, a, lda, af, ldaf, ipiv, x, info, work, rwork)
ZLA_GERCOND_X computes the infinity norm condition number of op(A)*diag(x) for general matrices.
subroutine zla_gerfsx_extended(prec_type, trans_type, n, nrhs, a, lda, af, ldaf, ipiv, colequ, c, b, ldb, y, ldy, berr_out, n_norms, errs_n, errs_c, res, ayb, dy, y_tail, rcond, ithresh, rthresh, dz_ub, ignore_cwise, info)
ZLA_GERFSX_EXTENDED
double precision function dlamch(cmach)
DLAMCH
double precision function zlange(norm, m, n, a, lda, work)
ZLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
logical function lsame(ca, cb)
LSAME