LAPACK 3.11.0 LAPACK: Linear Algebra PACKage
Searching...
No Matches

## ◆ dposvxx()

 subroutine dposvxx ( character FACT, character UPLO, integer N, integer NRHS, double precision, dimension( lda, * ) A, integer LDA, double precision, dimension( ldaf, * ) AF, integer LDAF, character EQUED, double precision, dimension( * ) S, double precision, dimension( ldb, * ) B, integer LDB, double precision, dimension( ldx, * ) X, integer LDX, double precision RCOND, double precision RPVGRW, double precision, dimension( * ) BERR, integer N_ERR_BNDS, double precision, dimension( nrhs, * ) ERR_BNDS_NORM, double precision, dimension( nrhs, * ) ERR_BNDS_COMP, integer NPARAMS, double precision, dimension( * ) PARAMS, double precision, dimension( * ) WORK, integer, dimension( * ) IWORK, integer INFO )

DPOSVXX computes the solution to system of linear equations A * X = B for PO matrices

Purpose:
DPOSVXX uses the Cholesky factorization A = U**T*U or A = L*L**T
to compute the solution to a double precision system of linear equations
A * X = B, where A is an N-by-N symmetric positive definite matrix
and X and B are N-by-NRHS matrices.

If requested, both normwise and maximum componentwise error bounds
are returned. DPOSVXX will return a solution with a tiny
guaranteed error (O(eps) where eps is the working machine
precision) unless the matrix is very ill-conditioned, in which
case a warning is returned. Relevant condition numbers also are
calculated and returned.

DPOSVXX accepts user-provided factorizations and equilibration
factors; see the definitions of the FACT and EQUED options.
Solving with refinement and using a factorization from a previous
DPOSVXX call will also produce a solution with either O(eps)
errors or warnings, but we cannot make that claim for general
user-provided factorizations and equilibration factors if they
differ from what DPOSVXX would itself produce.
Description:
The following steps are performed:

1. If FACT = 'E', double precision scaling factors are computed to equilibrate
the system:

diag(S)*A*diag(S)     *inv(diag(S))*X = diag(S)*B

Whether or not the system will be equilibrated depends on the
scaling of the matrix A, but if equilibration is used, A is
overwritten by diag(S)*A*diag(S) and B by diag(S)*B.

2. If FACT = 'N' or 'E', the Cholesky decomposition is used to
factor the matrix A (after equilibration if FACT = 'E') as
A = U**T* U,  if UPLO = 'U', or
A = L * L**T,  if UPLO = 'L',
where U is an upper triangular matrix and L is a lower triangular
matrix.

3. If the leading i-by-i principal minor is not positive definite,
then the routine returns with INFO = i. Otherwise, the factored
form of A is used to estimate the condition number of the matrix
A (see argument RCOND).  If the reciprocal of the condition number
is less than machine precision, the routine still goes on to solve
for X and compute error bounds as described below.

4. The system of equations is solved for X using the factored form
of A.

5. By default (unless PARAMS(LA_LINRX_ITREF_I) is set to zero),
the routine will use iterative refinement to try to get a small
error and error bounds.  Refinement calculates the residual to at
least twice the working precision.

6. If equilibration was used, the matrix X is premultiplied by
diag(S) so that it solves the original system before
equilibration.
Some optional parameters are bundled in the PARAMS array.  These
settings determine how refinement is performed, but often the
defaults are acceptable.  If the defaults are acceptable, users
can pass NPARAMS = 0 which prevents the source code from accessing
the PARAMS argument.
Parameters

Definition at line 490 of file dposvxx.f.

494*
495* -- LAPACK driver routine --
496* -- LAPACK is a software package provided by Univ. of Tennessee, --
497* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
498*
499* .. Scalar Arguments ..
500 CHARACTER EQUED, FACT, UPLO
501 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS, NPARAMS,
502 \$ N_ERR_BNDS
503 DOUBLE PRECISION RCOND, RPVGRW
504* ..
505* .. Array Arguments ..
506 INTEGER IWORK( * )
507 DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
508 \$ X( LDX, * ), WORK( * )
509 DOUBLE PRECISION S( * ), PARAMS( * ), BERR( * ),
510 \$ ERR_BNDS_NORM( NRHS, * ),
511 \$ ERR_BNDS_COMP( NRHS, * )
512* ..
513*
514* ==================================================================
515*
516* .. Parameters ..
517 DOUBLE PRECISION ZERO, ONE
518 parameter( zero = 0.0d+0, one = 1.0d+0 )
519 INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
520 INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
521 INTEGER CMP_ERR_I, PIV_GROWTH_I
522 parameter( final_nrm_err_i = 1, final_cmp_err_i = 2,
523 \$ berr_i = 3 )
524 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
525 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
526 \$ piv_growth_i = 9 )
527* ..
528* .. Local Scalars ..
529 LOGICAL EQUIL, NOFACT, RCEQU
530 INTEGER INFEQU, J
531 DOUBLE PRECISION AMAX, BIGNUM, SMIN, SMAX,
532 \$ SCOND, SMLNUM
533* ..
534* .. External Functions ..
535 EXTERNAL lsame, dlamch, dla_porpvgrw
536 LOGICAL LSAME
537 DOUBLE PRECISION DLAMCH, DLA_PORPVGRW
538* ..
539* .. External Subroutines ..
540 EXTERNAL dpoequb, dpotrf, dpotrs, dlacpy, dlaqsy,
542* ..
543* .. Intrinsic Functions ..
544 INTRINSIC max, min
545* ..
546* .. Executable Statements ..
547*
548 info = 0
549 nofact = lsame( fact, 'N' )
550 equil = lsame( fact, 'E' )
551 smlnum = dlamch( 'Safe minimum' )
552 bignum = one / smlnum
553 IF( nofact .OR. equil ) THEN
554 equed = 'N'
555 rcequ = .false.
556 ELSE
557 rcequ = lsame( equed, 'Y' )
558 ENDIF
559*
560* Default is failure. If an input parameter is wrong or
561* factorization fails, make everything look horrible. Only the
562* pivot growth is set here, the rest is initialized in DPORFSX.
563*
564 rpvgrw = zero
565*
566* Test the input parameters. PARAMS is not tested until DPORFSX.
567*
568 IF( .NOT.nofact .AND. .NOT.equil .AND. .NOT.
569 \$ lsame( fact, 'F' ) ) THEN
570 info = -1
571 ELSE IF( .NOT.lsame( uplo, 'U' ) .AND.
572 \$ .NOT.lsame( uplo, 'L' ) ) THEN
573 info = -2
574 ELSE IF( n.LT.0 ) THEN
575 info = -3
576 ELSE IF( nrhs.LT.0 ) THEN
577 info = -4
578 ELSE IF( lda.LT.max( 1, n ) ) THEN
579 info = -6
580 ELSE IF( ldaf.LT.max( 1, n ) ) THEN
581 info = -8
582 ELSE IF( lsame( fact, 'F' ) .AND. .NOT.
583 \$ ( rcequ .OR. lsame( equed, 'N' ) ) ) THEN
584 info = -9
585 ELSE
586 IF ( rcequ ) THEN
587 smin = bignum
588 smax = zero
589 DO 10 j = 1, n
590 smin = min( smin, s( j ) )
591 smax = max( smax, s( j ) )
592 10 CONTINUE
593 IF( smin.LE.zero ) THEN
594 info = -10
595 ELSE IF( n.GT.0 ) THEN
596 scond = max( smin, smlnum ) / min( smax, bignum )
597 ELSE
598 scond = one
599 END IF
600 END IF
601 IF( info.EQ.0 ) THEN
602 IF( ldb.LT.max( 1, n ) ) THEN
603 info = -12
604 ELSE IF( ldx.LT.max( 1, n ) ) THEN
605 info = -14
606 END IF
607 END IF
608 END IF
609*
610 IF( info.NE.0 ) THEN
611 CALL xerbla( 'DPOSVXX', -info )
612 RETURN
613 END IF
614*
615 IF( equil ) THEN
616*
617* Compute row and column scalings to equilibrate the matrix A.
618*
619 CALL dpoequb( n, a, lda, s, scond, amax, infequ )
620 IF( infequ.EQ.0 ) THEN
621*
622* Equilibrate the matrix.
623*
624 CALL dlaqsy( uplo, n, a, lda, s, scond, amax, equed )
625 rcequ = lsame( equed, 'Y' )
626 END IF
627 END IF
628*
629* Scale the right-hand side.
630*
631 IF( rcequ ) CALL dlascl2( n, nrhs, s, b, ldb )
632*
633 IF( nofact .OR. equil ) THEN
634*
635* Compute the Cholesky factorization of A.
636*
637 CALL dlacpy( uplo, n, n, a, lda, af, ldaf )
638 CALL dpotrf( uplo, n, af, ldaf, info )
639*
640* Return if INFO is non-zero.
641*
642 IF( info.NE.0 ) THEN
643*
644* Pivot in column INFO is exactly 0
645* Compute the reciprocal pivot growth factor of the
646* leading rank-deficient INFO columns of A.
647*
648 rpvgrw = dla_porpvgrw( uplo, info, a, lda, af, ldaf, work )
649 RETURN
650 ENDIF
651 END IF
652*
653* Compute the reciprocal growth factor RPVGRW.
654*
655 rpvgrw = dla_porpvgrw( uplo, n, a, lda, af, ldaf, work )
656*
657* Compute the solution matrix X.
658*
659 CALL dlacpy( 'Full', n, nrhs, b, ldb, x, ldx )
660 CALL dpotrs( uplo, n, nrhs, af, ldaf, x, ldx, info )
661*
662* Use iterative refinement to improve the computed solution and
663* compute error bounds and backward error estimates for it.
664*
665 CALL dporfsx( uplo, equed, n, nrhs, a, lda, af, ldaf,
666 \$ s, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
667 \$ err_bnds_comp, nparams, params, work, iwork, info )
668
669*
670* Scale solutions.
671*
672 IF ( rcequ ) THEN
673 CALL dlascl2 ( n, nrhs, s, x, ldx )
674 END IF
675*
676 RETURN
677*
678* End of DPOSVXX
679*
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:69
subroutine dlacpy(UPLO, M, N, A, LDA, B, LDB)
DLACPY copies all or part of one two-dimensional array to another.
Definition: dlacpy.f:103
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
subroutine dlascl2(M, N, D, X, LDX)
DLASCL2 performs diagonal scaling on a matrix.
Definition: dlascl2.f:90
subroutine dpotrs(UPLO, N, NRHS, A, LDA, B, LDB, INFO)
DPOTRS
Definition: dpotrs.f:110
subroutine dpotrf(UPLO, N, A, LDA, INFO)
DPOTRF
Definition: dpotrf.f:107
subroutine dporfsx(UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, S, B, LDB, X, LDX, RCOND, BERR, N_ERR_BNDS, ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, WORK, IWORK, INFO)
DPORFSX
Definition: dporfsx.f:394
subroutine dpoequb(N, A, LDA, S, SCOND, AMAX, INFO)
DPOEQUB
Definition: dpoequb.f:118
double precision function dla_porpvgrw(UPLO, NCOLS, A, LDA, AF, LDAF, WORK)
DLA_PORPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a symmetric or Hermitian...
Definition: dla_porpvgrw.f:106
subroutine dlaqsy(UPLO, N, A, LDA, S, SCOND, AMAX, EQUED)
DLAQSY scales a symmetric/Hermitian matrix, using scaling factors computed by spoequ.
Definition: dlaqsy.f:133
Here is the call graph for this function:
Here is the caller graph for this function: