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