1 *> \brief <b> DPOSV computes the solution to system of linear equations A * X = B for PO matrices</b>
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DPOSV + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dposv.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dposv.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dposv.f">
21 * SUBROUTINE DPOSV( UPLO, N, NRHS, A, LDA, B, LDB, INFO )
23 * .. Scalar Arguments ..
25 * INTEGER INFO, LDA, LDB, N, NRHS
27 * .. Array Arguments ..
28 * DOUBLE PRECISION A( LDA, * ), B( LDB, * )
37 *> DPOSV computes the solution to a real system of linear equations
39 *> where A is an N-by-N symmetric positive definite matrix and X and B
40 *> are N-by-NRHS matrices.
42 *> The Cholesky decomposition is used to factor A as
43 *> A = U**T* U, if UPLO = 'U', or
44 *> A = L * L**T, if UPLO = 'L',
45 *> where U is an upper triangular matrix and L is a lower triangular
46 *> matrix. The factored form of A is then used to solve the system of
47 *> equations A * X = B.
55 *> UPLO is CHARACTER*1
56 *> = 'U': Upper triangle of A is stored;
57 *> = 'L': Lower triangle of A is stored.
63 *> The number of linear equations, i.e., the order of the
70 *> The number of right hand sides, i.e., the number of columns
71 *> of the matrix B. NRHS >= 0.
76 *> A is DOUBLE PRECISION array, dimension (LDA,N)
77 *> On entry, the symmetric matrix A. If UPLO = 'U', the leading
78 *> N-by-N upper triangular part of A contains the upper
79 *> triangular part of the matrix A, and the strictly lower
80 *> triangular part of A is not referenced. If UPLO = 'L', the
81 *> leading N-by-N lower triangular part of A contains the lower
82 *> triangular part of the matrix A, and the strictly upper
83 *> triangular part of A is not referenced.
85 *> On exit, if INFO = 0, the factor U or L from the Cholesky
86 *> factorization A = U**T*U or A = L*L**T.
92 *> The leading dimension of the array A. LDA >= max(1,N).
97 *> B is DOUBLE PRECISION array, dimension (LDB,NRHS)
98 *> On entry, the N-by-NRHS right hand side matrix B.
99 *> On exit, if INFO = 0, the N-by-NRHS solution matrix X.
105 *> The leading dimension of the array B. LDB >= max(1,N).
111 *> = 0: successful exit
112 *> < 0: if INFO = -i, the i-th argument had an illegal value
113 *> > 0: if INFO = i, the leading minor of order i of A is not
114 *> positive definite, so the factorization could not be
115 *> completed, and the solution has not been computed.
121 *> \author Univ. of Tennessee
122 *> \author Univ. of California Berkeley
123 *> \author Univ. of Colorado Denver
126 *> \date November 2011
128 *> \ingroup doublePOsolve
130 * =====================================================================
131 SUBROUTINE DPOSV( UPLO, N, NRHS, A, LDA, B, LDB, INFO )
133 * -- LAPACK driver routine (version 3.4.0) --
134 * -- LAPACK is a software package provided by Univ. of Tennessee, --
135 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
138 * .. Scalar Arguments ..
140 INTEGER INFO, LDA, LDB, N, NRHS
142 * .. Array Arguments ..
143 DOUBLE PRECISION A( LDA, * ), B( LDB, * )
146 * =====================================================================
148 * .. External Functions ..
152 * .. External Subroutines ..
153 EXTERNAL DPOTRF, DPOTRS, XERBLA
155 * .. Intrinsic Functions ..
158 * .. Executable Statements ..
160 * Test the input parameters.
163 IF( .NOT.LSAME( UPLO, 'U' ) .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
165 ELSE IF( N.LT.0 ) THEN
167 ELSE IF( NRHS.LT.0 ) THEN
169 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
171 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
175 CALL XERBLA( 'DPOSV ', -INFO )
179 * Compute the Cholesky factorization A = U**T*U or A = L*L**T.
181 CALL DPOTRF( UPLO, N, A, LDA, INFO )
184 * Solve the system A*X = B, overwriting B with X.
186 CALL DPOTRS( UPLO, N, NRHS, A, LDA, B, LDB, INFO )