540 SUBROUTINE sgesvxx( FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV,
541 $ equed, r, c, b, ldb, x, ldx, rcond, rpvgrw,
542 $ berr, n_err_bnds, err_bnds_norm,
543 $ err_bnds_comp, nparams, params, work, iwork,
552 CHARACTER equed, fact, trans
553 INTEGER info, lda, ldaf, ldb, ldx, n, nrhs, nparams,
558 INTEGER ipiv( * ), iwork( * )
559 REAL a( lda, * ), af( ldaf, * ), b( ldb, * ),
560 $ x( ldx , * ),work( * )
561 REAL r( * ), c( * ), params( * ), berr( * ),
562 $ err_bnds_norm( nrhs, * ),
563 $ err_bnds_comp( nrhs, * )
570 parameter( zero = 0.0e+0, one = 1.0e+0 )
571 INTEGER final_nrm_err_i, final_cmp_err_i, berr_i
572 INTEGER rcond_i, nrm_rcond_i, nrm_err_i, cmp_rcond_i
573 INTEGER cmp_err_i, piv_growth_i
574 parameter( final_nrm_err_i = 1, final_cmp_err_i = 2,
576 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
577 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
581 LOGICAL colequ, equil, nofact, notran, rowequ
583 REAL amax, bignum, colcnd, rcmax, rcmin, rowcnd,
601 nofact =
lsame( fact,
'N' )
602 equil =
lsame( fact,
'E' )
603 notran =
lsame( trans,
'N' )
604 smlnum =
slamch(
'Safe minimum' )
605 bignum = one / smlnum
606 IF( nofact .OR. equil )
THEN
611 rowequ =
lsame( equed,
'R' ) .OR.
lsame( equed,
'B' )
612 colequ =
lsame( equed,
'C' ) .OR.
lsame( equed,
'B' )
623 IF( .NOT.nofact .AND. .NOT.equil .AND. .NOT.
624 $
lsame( fact,
'F' ) )
THEN
626 ELSE IF( .NOT.notran .AND. .NOT.
lsame( trans,
'T' ) .AND. .NOT.
627 $
lsame( trans,
'C' ) )
THEN
629 ELSE IF( n.LT.0 )
THEN
631 ELSE IF( nrhs.LT.0 )
THEN
633 ELSE IF( lda.LT.max( 1, n ) )
THEN
635 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
637 ELSE IF(
lsame( fact,
'F' ) .AND. .NOT.
638 $ ( rowequ .OR. colequ .OR.
lsame( equed,
'N' ) ) )
THEN
645 rcmin = min( rcmin, r( j ) )
646 rcmax = max( rcmax, r( j ) )
648 IF( rcmin.LE.zero )
THEN
650 ELSE IF( n.GT.0 )
THEN
651 rowcnd = max( rcmin, smlnum ) / min( rcmax, bignum )
656 IF( colequ .AND. info.EQ.0 )
THEN
660 rcmin = min( rcmin, c( j ) )
661 rcmax = max( rcmax, c( j ) )
663 IF( rcmin.LE.zero )
THEN
665 ELSE IF( n.GT.0 )
THEN
666 colcnd = max( rcmin, smlnum ) / min( rcmax, bignum )
672 IF( ldb.LT.max( 1, n ) )
THEN
674 ELSE IF( ldx.LT.max( 1, n ) )
THEN
681 CALL
xerbla(
'SGESVXX', -info )
689 CALL
sgeequb( n, n, a, lda, r, c, rowcnd, colcnd, amax,
691 IF( infequ.EQ.0 )
THEN
695 CALL
slaqge( n, n, a, lda, r, c, rowcnd, colcnd, amax,
697 rowequ =
lsame( equed,
'R' ) .OR.
lsame( equed,
'B' )
698 colequ =
lsame( equed,
'C' ) .OR.
lsame( equed,
'B' )
703 IF ( .NOT.rowequ )
THEN
708 IF ( .NOT.colequ )
THEN
718 IF( rowequ ) CALL
slascl2( n, nrhs, r, b, ldb )
720 IF( colequ ) CALL
slascl2( n, nrhs, c, b, ldb )
723 IF( nofact .OR. equil )
THEN
727 CALL
slacpy(
'Full', n, n, a, lda, af, ldaf )
728 CALL
sgetrf( n, n, af, ldaf, ipiv, info )
749 CALL
slacpy(
'Full', n, nrhs, b, ldb, x, ldx )
750 CALL
sgetrs( trans, n, nrhs, af, ldaf, ipiv, x, ldx, info )
755 CALL
sgerfsx( trans, equed, n, nrhs, a, lda, af, ldaf,
756 $ ipiv, r, c, b, ldb, x, ldx, rcond, berr,
757 $ n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params,
758 $ work, iwork, info )
762 IF ( colequ .AND. notran )
THEN
763 CALL
slascl2( n, nrhs, c, x, ldx )
764 ELSE IF ( rowequ .AND. .NOT.notran )
THEN
765 CALL
slascl2( n, nrhs, r, x, ldx )