![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief <b> DPOSV computes the solution to system of linear equations A * X = B for PO matrices</b> 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download DPOSV + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dposv.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dposv.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dposv.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE DPOSV( UPLO, N, NRHS, A, LDA, B, LDB, INFO ) 00022 * 00023 * .. Scalar Arguments .. 00024 * CHARACTER UPLO 00025 * INTEGER INFO, LDA, LDB, N, NRHS 00026 * .. 00027 * .. Array Arguments .. 00028 * DOUBLE PRECISION A( LDA, * ), B( LDB, * ) 00029 * .. 00030 * 00031 * 00032 *> \par Purpose: 00033 * ============= 00034 *> 00035 *> \verbatim 00036 *> 00037 *> DPOSV computes the solution to a real system of linear equations 00038 *> A * X = B, 00039 *> where A is an N-by-N symmetric positive definite matrix and X and B 00040 *> are N-by-NRHS matrices. 00041 *> 00042 *> The Cholesky decomposition is used to factor A as 00043 *> A = U**T* U, if UPLO = 'U', or 00044 *> A = L * L**T, if UPLO = 'L', 00045 *> where U is an upper triangular matrix and L is a lower triangular 00046 *> matrix. The factored form of A is then used to solve the system of 00047 *> equations A * X = B. 00048 *> \endverbatim 00049 * 00050 * Arguments: 00051 * ========== 00052 * 00053 *> \param[in] UPLO 00054 *> \verbatim 00055 *> UPLO is CHARACTER*1 00056 *> = 'U': Upper triangle of A is stored; 00057 *> = 'L': Lower triangle of A is stored. 00058 *> \endverbatim 00059 *> 00060 *> \param[in] N 00061 *> \verbatim 00062 *> N is INTEGER 00063 *> The number of linear equations, i.e., the order of the 00064 *> matrix A. N >= 0. 00065 *> \endverbatim 00066 *> 00067 *> \param[in] NRHS 00068 *> \verbatim 00069 *> NRHS is INTEGER 00070 *> The number of right hand sides, i.e., the number of columns 00071 *> of the matrix B. NRHS >= 0. 00072 *> \endverbatim 00073 *> 00074 *> \param[in,out] A 00075 *> \verbatim 00076 *> A is DOUBLE PRECISION array, dimension (LDA,N) 00077 *> On entry, the symmetric matrix A. If UPLO = 'U', the leading 00078 *> N-by-N upper triangular part of A contains the upper 00079 *> triangular part of the matrix A, and the strictly lower 00080 *> triangular part of A is not referenced. If UPLO = 'L', the 00081 *> leading N-by-N lower triangular part of A contains the lower 00082 *> triangular part of the matrix A, and the strictly upper 00083 *> triangular part of A is not referenced. 00084 *> 00085 *> On exit, if INFO = 0, the factor U or L from the Cholesky 00086 *> factorization A = U**T*U or A = L*L**T. 00087 *> \endverbatim 00088 *> 00089 *> \param[in] LDA 00090 *> \verbatim 00091 *> LDA is INTEGER 00092 *> The leading dimension of the array A. LDA >= max(1,N). 00093 *> \endverbatim 00094 *> 00095 *> \param[in,out] B 00096 *> \verbatim 00097 *> B is DOUBLE PRECISION array, dimension (LDB,NRHS) 00098 *> On entry, the N-by-NRHS right hand side matrix B. 00099 *> On exit, if INFO = 0, the N-by-NRHS solution matrix X. 00100 *> \endverbatim 00101 *> 00102 *> \param[in] LDB 00103 *> \verbatim 00104 *> LDB is INTEGER 00105 *> The leading dimension of the array B. LDB >= max(1,N). 00106 *> \endverbatim 00107 *> 00108 *> \param[out] INFO 00109 *> \verbatim 00110 *> INFO is INTEGER 00111 *> = 0: successful exit 00112 *> < 0: if INFO = -i, the i-th argument had an illegal value 00113 *> > 0: if INFO = i, the leading minor of order i of A is not 00114 *> positive definite, so the factorization could not be 00115 *> completed, and the solution has not been computed. 00116 *> \endverbatim 00117 * 00118 * Authors: 00119 * ======== 00120 * 00121 *> \author Univ. of Tennessee 00122 *> \author Univ. of California Berkeley 00123 *> \author Univ. of Colorado Denver 00124 *> \author NAG Ltd. 00125 * 00126 *> \date November 2011 00127 * 00128 *> \ingroup doublePOsolve 00129 * 00130 * ===================================================================== 00131 SUBROUTINE DPOSV( UPLO, N, NRHS, A, LDA, B, LDB, INFO ) 00132 * 00133 * -- LAPACK driver routine (version 3.4.0) -- 00134 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00135 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00136 * November 2011 00137 * 00138 * .. Scalar Arguments .. 00139 CHARACTER UPLO 00140 INTEGER INFO, LDA, LDB, N, NRHS 00141 * .. 00142 * .. Array Arguments .. 00143 DOUBLE PRECISION A( LDA, * ), B( LDB, * ) 00144 * .. 00145 * 00146 * ===================================================================== 00147 * 00148 * .. External Functions .. 00149 LOGICAL LSAME 00150 EXTERNAL LSAME 00151 * .. 00152 * .. External Subroutines .. 00153 EXTERNAL DPOTRF, DPOTRS, XERBLA 00154 * .. 00155 * .. Intrinsic Functions .. 00156 INTRINSIC MAX 00157 * .. 00158 * .. Executable Statements .. 00159 * 00160 * Test the input parameters. 00161 * 00162 INFO = 0 00163 IF( .NOT.LSAME( UPLO, 'U' ) .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN 00164 INFO = -1 00165 ELSE IF( N.LT.0 ) THEN 00166 INFO = -2 00167 ELSE IF( NRHS.LT.0 ) THEN 00168 INFO = -3 00169 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN 00170 INFO = -5 00171 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN 00172 INFO = -7 00173 END IF 00174 IF( INFO.NE.0 ) THEN 00175 CALL XERBLA( 'DPOSV ', -INFO ) 00176 RETURN 00177 END IF 00178 * 00179 * Compute the Cholesky factorization A = U**T*U or A = L*L**T. 00180 * 00181 CALL DPOTRF( UPLO, N, A, LDA, INFO ) 00182 IF( INFO.EQ.0 ) THEN 00183 * 00184 * Solve the system A*X = B, overwriting B with X. 00185 * 00186 CALL DPOTRS( UPLO, N, NRHS, A, LDA, B, LDB, INFO ) 00187 * 00188 END IF 00189 RETURN 00190 * 00191 * End of DPOSV 00192 * 00193 END