348 SUBROUTINE dgesvx( FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV,
349 $ equed, r, c, b, ldb, x, ldx, rcond, ferr, berr,
350 $ work, iwork, info )
358 CHARACTER EQUED, FACT, TRANS
359 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS
360 DOUBLE PRECISION RCOND
363 INTEGER IPIV( * ), IWORK( * )
364 DOUBLE PRECISION A( lda, * ), AF( ldaf, * ), B( ldb, * ),
365 $ berr( * ), c( * ), ferr( * ), r( * ),
366 $ work( * ), x( ldx, * )
372 DOUBLE PRECISION ZERO, ONE
373 parameter ( zero = 0.0d+0, one = 1.0d+0 )
376 LOGICAL COLEQU, EQUIL, NOFACT, NOTRAN, ROWEQU
379 DOUBLE PRECISION AMAX, ANORM, BIGNUM, COLCND, RCMAX, RCMIN,
380 $ rowcnd, rpvgrw, smlnum
384 DOUBLE PRECISION DLAMCH, DLANGE, DLANTR
385 EXTERNAL lsame, dlamch, dlange, dlantr
397 nofact = lsame( fact,
'N' )
398 equil = lsame( fact,
'E' )
399 notran = lsame( trans,
'N' )
400 IF( nofact .OR. equil )
THEN
405 rowequ = lsame( equed,
'R' ) .OR. lsame( equed,
'B' )
406 colequ = lsame( equed,
'C' ) .OR. lsame( equed,
'B' )
407 smlnum = dlamch(
'Safe minimum' )
408 bignum = one / smlnum
413 IF( .NOT.nofact .AND. .NOT.equil .AND. .NOT.lsame( fact,
'F' ) )
416 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans,
'T' ) .AND. .NOT.
417 $ lsame( trans,
'C' ) )
THEN
419 ELSE IF( n.LT.0 )
THEN
421 ELSE IF( nrhs.LT.0 )
THEN
423 ELSE IF( lda.LT.max( 1, n ) )
THEN
425 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
427 ELSE IF( lsame( fact,
'F' ) .AND. .NOT.
428 $ ( rowequ .OR. colequ .OR. lsame( equed,
'N' ) ) )
THEN
435 rcmin = min( rcmin, r( j ) )
436 rcmax = max( rcmax, r( j ) )
438 IF( rcmin.LE.zero )
THEN
440 ELSE IF( n.GT.0 )
THEN
441 rowcnd = max( rcmin, smlnum ) / min( rcmax, bignum )
446 IF( colequ .AND. info.EQ.0 )
THEN
450 rcmin = min( rcmin, c( j ) )
451 rcmax = max( rcmax, c( j ) )
453 IF( rcmin.LE.zero )
THEN
455 ELSE IF( n.GT.0 )
THEN
456 colcnd = max( rcmin, smlnum ) / min( rcmax, bignum )
462 IF( ldb.LT.max( 1, n ) )
THEN
464 ELSE IF( ldx.LT.max( 1, n ) )
THEN
471 CALL xerbla(
'DGESVX', -info )
479 CALL dgeequ( n, n, a, lda, r, c, rowcnd, colcnd, amax, infequ )
480 IF( infequ.EQ.0 )
THEN
484 CALL dlaqge( n, n, a, lda, r, c, rowcnd, colcnd, amax,
486 rowequ = lsame( equed,
'R' ) .OR. lsame( equed,
'B' )
487 colequ = lsame( equed,
'C' ) .OR. lsame( equed,
'B' )
497 b( i, j ) = r( i )*b( i, j )
501 ELSE IF( colequ )
THEN
504 b( i, j ) = c( i )*b( i, j )
509 IF( nofact .OR. equil )
THEN
513 CALL dlacpy(
'Full', n, n, a, lda, af, ldaf )
514 CALL dgetrf( n, n, af, ldaf, ipiv, info )
523 rpvgrw = dlantr(
'M',
'U',
'N', info, info, af, ldaf,
525 IF( rpvgrw.EQ.zero )
THEN
528 rpvgrw = dlange(
'M', n, info, a, lda, work ) / rpvgrw
544 anorm = dlange( norm, n, n, a, lda, work )
545 rpvgrw = dlantr(
'M',
'U',
'N', n, n, af, ldaf, work )
546 IF( rpvgrw.EQ.zero )
THEN
549 rpvgrw = dlange(
'M', n, n, a, lda, work ) / rpvgrw
554 CALL dgecon( norm, n, af, ldaf, anorm, rcond, work, iwork, info )
558 CALL dlacpy(
'Full', n, nrhs, b, ldb, x, ldx )
559 CALL dgetrs( trans, n, nrhs, af, ldaf, ipiv, x, ldx, info )
564 CALL dgerfs( trans, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x,
565 $ ldx, ferr, berr, work, iwork, info )
574 x( i, j ) = c( i )*x( i, j )
578 ferr( j ) = ferr( j ) / colcnd
581 ELSE IF( rowequ )
THEN
584 x( i, j ) = r( i )*x( i, j )
588 ferr( j ) = ferr( j ) / rowcnd
596 IF( rcond.LT.dlamch(
'Epsilon' ) )
subroutine dgetrf(M, N, A, LDA, IPIV, INFO)
DGETRF
subroutine dlaqge(M, N, A, LDA, R, C, ROWCND, COLCND, AMAX, EQUED)
DLAQGE scales a general rectangular matrix, using row and column scaling factors computed by sgeequ...
subroutine dgerfs(TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X, LDX, FERR, BERR, WORK, IWORK, INFO)
DGERFS
subroutine dlacpy(UPLO, M, N, A, LDA, B, LDB)
DLACPY copies all or part of one two-dimensional array to another.
subroutine dgeequ(M, N, A, LDA, R, C, ROWCND, COLCND, AMAX, INFO)
DGEEQU
subroutine dgetrs(TRANS, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
DGETRS
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine dgesvx(FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, EQUED, R, C, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, IWORK, INFO)
DGESVX computes the solution to system of linear equations A * X = B for GE matrices ...
subroutine dgecon(NORM, N, A, LDA, ANORM, RCOND, WORK, IWORK, INFO)
DGECON