![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b DPBTRS 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download DPBTRS + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dpbtrs.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dpbtrs.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpbtrs.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE DPBTRS( UPLO, N, KD, NRHS, AB, LDAB, B, LDB, INFO ) 00022 * 00023 * .. Scalar Arguments .. 00024 * CHARACTER UPLO 00025 * INTEGER INFO, KD, LDAB, LDB, N, NRHS 00026 * .. 00027 * .. Array Arguments .. 00028 * DOUBLE PRECISION AB( LDAB, * ), B( LDB, * ) 00029 * .. 00030 * 00031 * 00032 *> \par Purpose: 00033 * ============= 00034 *> 00035 *> \verbatim 00036 *> 00037 *> DPBTRS solves a system of linear equations A*X = B with a symmetric 00038 *> positive definite band matrix A using the Cholesky factorization 00039 *> A = U**T*U or A = L*L**T computed by DPBTRF. 00040 *> \endverbatim 00041 * 00042 * Arguments: 00043 * ========== 00044 * 00045 *> \param[in] UPLO 00046 *> \verbatim 00047 *> UPLO is CHARACTER*1 00048 *> = 'U': Upper triangular factor stored in AB; 00049 *> = 'L': Lower triangular factor stored in AB. 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] KD 00059 *> \verbatim 00060 *> KD is INTEGER 00061 *> The number of superdiagonals of the matrix A if UPLO = 'U', 00062 *> or the number of subdiagonals if UPLO = 'L'. KD >= 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] AB 00073 *> \verbatim 00074 *> AB is DOUBLE PRECISION array, dimension (LDAB,N) 00075 *> The triangular factor U or L from the Cholesky factorization 00076 *> A = U**T*U or A = L*L**T of the band matrix A, stored in the 00077 *> first KD+1 rows of the array. The j-th column of U or L is 00078 *> stored in the j-th column of the array AB as follows: 00079 *> if UPLO ='U', AB(kd+1+i-j,j) = U(i,j) for max(1,j-kd)<=i<=j; 00080 *> if UPLO ='L', AB(1+i-j,j) = L(i,j) for j<=i<=min(n,j+kd). 00081 *> \endverbatim 00082 *> 00083 *> \param[in] LDAB 00084 *> \verbatim 00085 *> LDAB is INTEGER 00086 *> The leading dimension of the array AB. LDAB >= KD+1. 00087 *> \endverbatim 00088 *> 00089 *> \param[in,out] B 00090 *> \verbatim 00091 *> B is DOUBLE PRECISION array, dimension (LDB,NRHS) 00092 *> On entry, the right hand side matrix B. 00093 *> On exit, the solution matrix X. 00094 *> \endverbatim 00095 *> 00096 *> \param[in] LDB 00097 *> \verbatim 00098 *> LDB is INTEGER 00099 *> The leading dimension of the array B. LDB >= max(1,N). 00100 *> \endverbatim 00101 *> 00102 *> \param[out] INFO 00103 *> \verbatim 00104 *> INFO is INTEGER 00105 *> = 0: successful exit 00106 *> < 0: if INFO = -i, the i-th argument had an illegal value 00107 *> \endverbatim 00108 * 00109 * Authors: 00110 * ======== 00111 * 00112 *> \author Univ. of Tennessee 00113 *> \author Univ. of California Berkeley 00114 *> \author Univ. of Colorado Denver 00115 *> \author NAG Ltd. 00116 * 00117 *> \date November 2011 00118 * 00119 *> \ingroup doubleOTHERcomputational 00120 * 00121 * ===================================================================== 00122 SUBROUTINE DPBTRS( UPLO, N, KD, NRHS, AB, LDAB, B, LDB, INFO ) 00123 * 00124 * -- LAPACK computational routine (version 3.4.0) -- 00125 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00126 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00127 * November 2011 00128 * 00129 * .. Scalar Arguments .. 00130 CHARACTER UPLO 00131 INTEGER INFO, KD, LDAB, LDB, N, NRHS 00132 * .. 00133 * .. Array Arguments .. 00134 DOUBLE PRECISION AB( LDAB, * ), B( LDB, * ) 00135 * .. 00136 * 00137 * ===================================================================== 00138 * 00139 * .. Local Scalars .. 00140 LOGICAL UPPER 00141 INTEGER J 00142 * .. 00143 * .. External Functions .. 00144 LOGICAL LSAME 00145 EXTERNAL LSAME 00146 * .. 00147 * .. External Subroutines .. 00148 EXTERNAL DTBSV, XERBLA 00149 * .. 00150 * .. Intrinsic Functions .. 00151 INTRINSIC MAX 00152 * .. 00153 * .. Executable Statements .. 00154 * 00155 * Test the input parameters. 00156 * 00157 INFO = 0 00158 UPPER = LSAME( UPLO, 'U' ) 00159 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN 00160 INFO = -1 00161 ELSE IF( N.LT.0 ) THEN 00162 INFO = -2 00163 ELSE IF( KD.LT.0 ) THEN 00164 INFO = -3 00165 ELSE IF( NRHS.LT.0 ) THEN 00166 INFO = -4 00167 ELSE IF( LDAB.LT.KD+1 ) THEN 00168 INFO = -6 00169 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN 00170 INFO = -8 00171 END IF 00172 IF( INFO.NE.0 ) THEN 00173 CALL XERBLA( 'DPBTRS', -INFO ) 00174 RETURN 00175 END IF 00176 * 00177 * Quick return if possible 00178 * 00179 IF( N.EQ.0 .OR. NRHS.EQ.0 ) 00180 $ RETURN 00181 * 00182 IF( UPPER ) THEN 00183 * 00184 * Solve A*X = B where A = U**T *U. 00185 * 00186 DO 10 J = 1, NRHS 00187 * 00188 * Solve U**T *X = B, overwriting B with X. 00189 * 00190 CALL DTBSV( 'Upper', 'Transpose', 'Non-unit', N, KD, AB, 00191 $ LDAB, B( 1, J ), 1 ) 00192 * 00193 * Solve U*X = B, overwriting B with X. 00194 * 00195 CALL DTBSV( 'Upper', 'No transpose', 'Non-unit', N, KD, AB, 00196 $ LDAB, B( 1, J ), 1 ) 00197 10 CONTINUE 00198 ELSE 00199 * 00200 * Solve A*X = B where A = L*L**T. 00201 * 00202 DO 20 J = 1, NRHS 00203 * 00204 * Solve L*X = B, overwriting B with X. 00205 * 00206 CALL DTBSV( 'Lower', 'No transpose', 'Non-unit', N, KD, AB, 00207 $ LDAB, B( 1, J ), 1 ) 00208 * 00209 * Solve L**T *X = B, overwriting B with X. 00210 * 00211 CALL DTBSV( 'Lower', 'Transpose', 'Non-unit', N, KD, AB, 00212 $ LDAB, B( 1, J ), 1 ) 00213 20 CONTINUE 00214 END IF 00215 * 00216 RETURN 00217 * 00218 * End of DPBTRS 00219 * 00220 END