![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b ZPFTRS 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download ZPFTRS + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zpftrs.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zpftrs.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zpftrs.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE ZPFTRS( TRANSR, UPLO, N, NRHS, A, B, LDB, INFO ) 00022 * 00023 * .. Scalar Arguments .. 00024 * CHARACTER TRANSR, UPLO 00025 * INTEGER INFO, LDB, N, NRHS 00026 * .. 00027 * .. Array Arguments .. 00028 * COMPLEX*16 A( 0: * ), B( LDB, * ) 00029 * .. 00030 * 00031 * 00032 *> \par Purpose: 00033 * ============= 00034 *> 00035 *> \verbatim 00036 *> 00037 *> ZPFTRS solves a system of linear equations A*X = B with a Hermitian 00038 *> positive definite matrix A using the Cholesky factorization 00039 *> A = U**H*U or A = L*L**H computed by ZPFTRF. 00040 *> \endverbatim 00041 * 00042 * Arguments: 00043 * ========== 00044 * 00045 *> \param[in] TRANSR 00046 *> \verbatim 00047 *> TRANSR is CHARACTER*1 00048 *> = 'N': The Normal TRANSR of RFP A is stored; 00049 *> = 'C': The Conjugate-transpose TRANSR of RFP A is stored. 00050 *> \endverbatim 00051 *> 00052 *> \param[in] UPLO 00053 *> \verbatim 00054 *> UPLO is CHARACTER*1 00055 *> = 'U': Upper triangle of RFP A is stored; 00056 *> = 'L': Lower triangle of RFP A is stored. 00057 *> \endverbatim 00058 *> 00059 *> \param[in] N 00060 *> \verbatim 00061 *> N is INTEGER 00062 *> The order of the matrix A. N >= 0. 00063 *> \endverbatim 00064 *> 00065 *> \param[in] NRHS 00066 *> \verbatim 00067 *> NRHS is INTEGER 00068 *> The number of right hand sides, i.e., the number of columns 00069 *> of the matrix B. NRHS >= 0. 00070 *> \endverbatim 00071 *> 00072 *> \param[in] A 00073 *> \verbatim 00074 *> A is COMPLEX*16 array, dimension ( N*(N+1)/2 ); 00075 *> The triangular factor U or L from the Cholesky factorization 00076 *> of RFP A = U**H*U or RFP A = L*L**H, as computed by ZPFTRF. 00077 *> See note below for more details about RFP A. 00078 *> \endverbatim 00079 *> 00080 *> \param[in,out] B 00081 *> \verbatim 00082 *> B is COMPLEX*16 array, dimension (LDB,NRHS) 00083 *> On entry, the right hand side matrix B. 00084 *> On exit, the solution matrix X. 00085 *> \endverbatim 00086 *> 00087 *> \param[in] LDB 00088 *> \verbatim 00089 *> LDB is INTEGER 00090 *> The leading dimension of the array B. LDB >= max(1,N). 00091 *> \endverbatim 00092 *> 00093 *> \param[out] INFO 00094 *> \verbatim 00095 *> INFO is INTEGER 00096 *> = 0: successful exit 00097 *> < 0: if INFO = -i, the i-th argument had an illegal value 00098 *> \endverbatim 00099 * 00100 * Authors: 00101 * ======== 00102 * 00103 *> \author Univ. of Tennessee 00104 *> \author Univ. of California Berkeley 00105 *> \author Univ. of Colorado Denver 00106 *> \author NAG Ltd. 00107 * 00108 *> \date November 2011 00109 * 00110 *> \ingroup complex16OTHERcomputational 00111 * 00112 *> \par Further Details: 00113 * ===================== 00114 *> 00115 *> \verbatim 00116 *> 00117 *> We first consider Standard Packed Format when N is even. 00118 *> We give an example where N = 6. 00119 *> 00120 *> AP is Upper AP is Lower 00121 *> 00122 *> 00 01 02 03 04 05 00 00123 *> 11 12 13 14 15 10 11 00124 *> 22 23 24 25 20 21 22 00125 *> 33 34 35 30 31 32 33 00126 *> 44 45 40 41 42 43 44 00127 *> 55 50 51 52 53 54 55 00128 *> 00129 *> 00130 *> Let TRANSR = 'N'. RFP holds AP as follows: 00131 *> For UPLO = 'U' the upper trapezoid A(0:5,0:2) consists of the last 00132 *> three columns of AP upper. The lower triangle A(4:6,0:2) consists of 00133 *> conjugate-transpose of the first three columns of AP upper. 00134 *> For UPLO = 'L' the lower trapezoid A(1:6,0:2) consists of the first 00135 *> three columns of AP lower. The upper triangle A(0:2,0:2) consists of 00136 *> conjugate-transpose of the last three columns of AP lower. 00137 *> To denote conjugate we place -- above the element. This covers the 00138 *> case N even and TRANSR = 'N'. 00139 *> 00140 *> RFP A RFP A 00141 *> 00142 *> -- -- -- 00143 *> 03 04 05 33 43 53 00144 *> -- -- 00145 *> 13 14 15 00 44 54 00146 *> -- 00147 *> 23 24 25 10 11 55 00148 *> 00149 *> 33 34 35 20 21 22 00150 *> -- 00151 *> 00 44 45 30 31 32 00152 *> -- -- 00153 *> 01 11 55 40 41 42 00154 *> -- -- -- 00155 *> 02 12 22 50 51 52 00156 *> 00157 *> Now let TRANSR = 'C'. RFP A in both UPLO cases is just the conjugate- 00158 *> transpose of RFP A above. One therefore gets: 00159 *> 00160 *> 00161 *> RFP A RFP A 00162 *> 00163 *> -- -- -- -- -- -- -- -- -- -- 00164 *> 03 13 23 33 00 01 02 33 00 10 20 30 40 50 00165 *> -- -- -- -- -- -- -- -- -- -- 00166 *> 04 14 24 34 44 11 12 43 44 11 21 31 41 51 00167 *> -- -- -- -- -- -- -- -- -- -- 00168 *> 05 15 25 35 45 55 22 53 54 55 22 32 42 52 00169 *> 00170 *> 00171 *> We next consider Standard Packed Format when N is odd. 00172 *> We give an example where N = 5. 00173 *> 00174 *> AP is Upper AP is Lower 00175 *> 00176 *> 00 01 02 03 04 00 00177 *> 11 12 13 14 10 11 00178 *> 22 23 24 20 21 22 00179 *> 33 34 30 31 32 33 00180 *> 44 40 41 42 43 44 00181 *> 00182 *> 00183 *> Let TRANSR = 'N'. RFP holds AP as follows: 00184 *> For UPLO = 'U' the upper trapezoid A(0:4,0:2) consists of the last 00185 *> three columns of AP upper. The lower triangle A(3:4,0:1) consists of 00186 *> conjugate-transpose of the first two columns of AP upper. 00187 *> For UPLO = 'L' the lower trapezoid A(0:4,0:2) consists of the first 00188 *> three columns of AP lower. The upper triangle A(0:1,1:2) consists of 00189 *> conjugate-transpose of the last two columns of AP lower. 00190 *> To denote conjugate we place -- above the element. This covers the 00191 *> case N odd and TRANSR = 'N'. 00192 *> 00193 *> RFP A RFP A 00194 *> 00195 *> -- -- 00196 *> 02 03 04 00 33 43 00197 *> -- 00198 *> 12 13 14 10 11 44 00199 *> 00200 *> 22 23 24 20 21 22 00201 *> -- 00202 *> 00 33 34 30 31 32 00203 *> -- -- 00204 *> 01 11 44 40 41 42 00205 *> 00206 *> Now let TRANSR = 'C'. RFP A in both UPLO cases is just the conjugate- 00207 *> transpose of RFP A above. One therefore gets: 00208 *> 00209 *> 00210 *> RFP A RFP A 00211 *> 00212 *> -- -- -- -- -- -- -- -- -- 00213 *> 02 12 22 00 01 00 10 20 30 40 50 00214 *> -- -- -- -- -- -- -- -- -- 00215 *> 03 13 23 33 11 33 11 21 31 41 51 00216 *> -- -- -- -- -- -- -- -- -- 00217 *> 04 14 24 34 44 43 44 22 32 42 52 00218 *> \endverbatim 00219 *> 00220 * ===================================================================== 00221 SUBROUTINE ZPFTRS( TRANSR, UPLO, N, NRHS, A, B, LDB, INFO ) 00222 * 00223 * -- LAPACK computational routine (version 3.4.0) -- 00224 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00225 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00226 * November 2011 00227 * 00228 * .. Scalar Arguments .. 00229 CHARACTER TRANSR, UPLO 00230 INTEGER INFO, LDB, N, NRHS 00231 * .. 00232 * .. Array Arguments .. 00233 COMPLEX*16 A( 0: * ), B( LDB, * ) 00234 * .. 00235 * 00236 * ===================================================================== 00237 * 00238 * .. Parameters .. 00239 COMPLEX*16 CONE 00240 PARAMETER ( CONE = ( 1.0D+0, 0.0D+0 ) ) 00241 * .. 00242 * .. Local Scalars .. 00243 LOGICAL LOWER, NORMALTRANSR 00244 * .. 00245 * .. External Functions .. 00246 LOGICAL LSAME 00247 EXTERNAL LSAME 00248 * .. 00249 * .. External Subroutines .. 00250 EXTERNAL XERBLA, ZTFSM 00251 * .. 00252 * .. Intrinsic Functions .. 00253 INTRINSIC MAX 00254 * .. 00255 * .. Executable Statements .. 00256 * 00257 * Test the input parameters. 00258 * 00259 INFO = 0 00260 NORMALTRANSR = LSAME( TRANSR, 'N' ) 00261 LOWER = LSAME( UPLO, 'L' ) 00262 IF( .NOT.NORMALTRANSR .AND. .NOT.LSAME( TRANSR, 'C' ) ) THEN 00263 INFO = -1 00264 ELSE IF( .NOT.LOWER .AND. .NOT.LSAME( UPLO, 'U' ) ) THEN 00265 INFO = -2 00266 ELSE IF( N.LT.0 ) THEN 00267 INFO = -3 00268 ELSE IF( NRHS.LT.0 ) THEN 00269 INFO = -4 00270 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN 00271 INFO = -7 00272 END IF 00273 IF( INFO.NE.0 ) THEN 00274 CALL XERBLA( 'ZPFTRS', -INFO ) 00275 RETURN 00276 END IF 00277 * 00278 * Quick return if possible 00279 * 00280 IF( N.EQ.0 .OR. NRHS.EQ.0 ) 00281 $ RETURN 00282 * 00283 * start execution: there are two triangular solves 00284 * 00285 IF( LOWER ) THEN 00286 CALL ZTFSM( TRANSR, 'L', UPLO, 'N', 'N', N, NRHS, CONE, A, B, 00287 $ LDB ) 00288 CALL ZTFSM( TRANSR, 'L', UPLO, 'C', 'N', N, NRHS, CONE, A, B, 00289 $ LDB ) 00290 ELSE 00291 CALL ZTFSM( TRANSR, 'L', UPLO, 'C', 'N', N, NRHS, CONE, A, B, 00292 $ LDB ) 00293 CALL ZTFSM( TRANSR, 'L', UPLO, 'N', 'N', N, NRHS, CONE, A, B, 00294 $ LDB ) 00295 END IF 00296 * 00297 RETURN 00298 * 00299 * End of ZPFTRS 00300 * 00301 END