![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief <b> DPBSV computes the solution to system of linear equations A * X = B for OTHER 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 DPBSV + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dpbsv.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dpbsv.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpbsv.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE DPBSV( 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 *> DPBSV 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 band matrix and X 00040 *> and B 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 band matrix, and L is a lower 00046 *> triangular band matrix, with the same number of superdiagonals or 00047 *> subdiagonals as A. The factored form of A is then used to solve the 00048 *> system of equations A * X = B. 00049 *> \endverbatim 00050 * 00051 * Arguments: 00052 * ========== 00053 * 00054 *> \param[in] UPLO 00055 *> \verbatim 00056 *> UPLO is CHARACTER*1 00057 *> = 'U': Upper triangle of A is stored; 00058 *> = 'L': Lower triangle of A is stored. 00059 *> \endverbatim 00060 *> 00061 *> \param[in] N 00062 *> \verbatim 00063 *> N is INTEGER 00064 *> The number of linear equations, i.e., the order of the 00065 *> matrix A. N >= 0. 00066 *> \endverbatim 00067 *> 00068 *> \param[in] KD 00069 *> \verbatim 00070 *> KD is INTEGER 00071 *> The number of superdiagonals of the matrix A if UPLO = 'U', 00072 *> or the number of subdiagonals if UPLO = 'L'. KD >= 0. 00073 *> \endverbatim 00074 *> 00075 *> \param[in] NRHS 00076 *> \verbatim 00077 *> NRHS is INTEGER 00078 *> The number of right hand sides, i.e., the number of columns 00079 *> of the matrix B. NRHS >= 0. 00080 *> \endverbatim 00081 *> 00082 *> \param[in,out] AB 00083 *> \verbatim 00084 *> AB is DOUBLE PRECISION array, dimension (LDAB,N) 00085 *> On entry, the upper or lower triangle of the symmetric band 00086 *> matrix A, stored in the first KD+1 rows of the array. The 00087 *> j-th column of A is stored in the j-th column of the array AB 00088 *> as follows: 00089 *> if UPLO = 'U', AB(KD+1+i-j,j) = A(i,j) for max(1,j-KD)<=i<=j; 00090 *> if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(N,j+KD). 00091 *> See below for further details. 00092 *> 00093 *> On exit, if INFO = 0, the triangular factor U or L from the 00094 *> Cholesky factorization A = U**T*U or A = L*L**T of the band 00095 *> matrix A, in the same storage format as A. 00096 *> \endverbatim 00097 *> 00098 *> \param[in] LDAB 00099 *> \verbatim 00100 *> LDAB is INTEGER 00101 *> The leading dimension of the array AB. LDAB >= KD+1. 00102 *> \endverbatim 00103 *> 00104 *> \param[in,out] B 00105 *> \verbatim 00106 *> B is DOUBLE PRECISION array, dimension (LDB,NRHS) 00107 *> On entry, the N-by-NRHS right hand side matrix B. 00108 *> On exit, if INFO = 0, the N-by-NRHS solution matrix X. 00109 *> \endverbatim 00110 *> 00111 *> \param[in] LDB 00112 *> \verbatim 00113 *> LDB is INTEGER 00114 *> The leading dimension of the array B. LDB >= max(1,N). 00115 *> \endverbatim 00116 *> 00117 *> \param[out] INFO 00118 *> \verbatim 00119 *> INFO is INTEGER 00120 *> = 0: successful exit 00121 *> < 0: if INFO = -i, the i-th argument had an illegal value 00122 *> > 0: if INFO = i, the leading minor of order i of A is not 00123 *> positive definite, so the factorization could not be 00124 *> completed, and the solution has not been computed. 00125 *> \endverbatim 00126 * 00127 * Authors: 00128 * ======== 00129 * 00130 *> \author Univ. of Tennessee 00131 *> \author Univ. of California Berkeley 00132 *> \author Univ. of Colorado Denver 00133 *> \author NAG Ltd. 00134 * 00135 *> \date November 2011 00136 * 00137 *> \ingroup doubleOTHERsolve 00138 * 00139 *> \par Further Details: 00140 * ===================== 00141 *> 00142 *> \verbatim 00143 *> 00144 *> The band storage scheme is illustrated by the following example, when 00145 *> N = 6, KD = 2, and UPLO = 'U': 00146 *> 00147 *> On entry: On exit: 00148 *> 00149 *> * * a13 a24 a35 a46 * * u13 u24 u35 u46 00150 *> * a12 a23 a34 a45 a56 * u12 u23 u34 u45 u56 00151 *> a11 a22 a33 a44 a55 a66 u11 u22 u33 u44 u55 u66 00152 *> 00153 *> Similarly, if UPLO = 'L' the format of A is as follows: 00154 *> 00155 *> On entry: On exit: 00156 *> 00157 *> a11 a22 a33 a44 a55 a66 l11 l22 l33 l44 l55 l66 00158 *> a21 a32 a43 a54 a65 * l21 l32 l43 l54 l65 * 00159 *> a31 a42 a53 a64 * * l31 l42 l53 l64 * * 00160 *> 00161 *> Array elements marked * are not used by the routine. 00162 *> \endverbatim 00163 *> 00164 * ===================================================================== 00165 SUBROUTINE DPBSV( UPLO, N, KD, NRHS, AB, LDAB, B, LDB, INFO ) 00166 * 00167 * -- LAPACK driver routine (version 3.4.0) -- 00168 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00169 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00170 * November 2011 00171 * 00172 * .. Scalar Arguments .. 00173 CHARACTER UPLO 00174 INTEGER INFO, KD, LDAB, LDB, N, NRHS 00175 * .. 00176 * .. Array Arguments .. 00177 DOUBLE PRECISION AB( LDAB, * ), B( LDB, * ) 00178 * .. 00179 * 00180 * ===================================================================== 00181 * 00182 * .. External Functions .. 00183 LOGICAL LSAME 00184 EXTERNAL LSAME 00185 * .. 00186 * .. External Subroutines .. 00187 EXTERNAL DPBTRF, DPBTRS, XERBLA 00188 * .. 00189 * .. Intrinsic Functions .. 00190 INTRINSIC MAX 00191 * .. 00192 * .. Executable Statements .. 00193 * 00194 * Test the input parameters. 00195 * 00196 INFO = 0 00197 IF( .NOT.LSAME( UPLO, 'U' ) .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN 00198 INFO = -1 00199 ELSE IF( N.LT.0 ) THEN 00200 INFO = -2 00201 ELSE IF( KD.LT.0 ) THEN 00202 INFO = -3 00203 ELSE IF( NRHS.LT.0 ) THEN 00204 INFO = -4 00205 ELSE IF( LDAB.LT.KD+1 ) THEN 00206 INFO = -6 00207 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN 00208 INFO = -8 00209 END IF 00210 IF( INFO.NE.0 ) THEN 00211 CALL XERBLA( 'DPBSV ', -INFO ) 00212 RETURN 00213 END IF 00214 * 00215 * Compute the Cholesky factorization A = U**T*U or A = L*L**T. 00216 * 00217 CALL DPBTRF( UPLO, N, KD, AB, LDAB, INFO ) 00218 IF( INFO.EQ.0 ) THEN 00219 * 00220 * Solve the system A*X = B, overwriting B with X. 00221 * 00222 CALL DPBTRS( UPLO, N, KD, NRHS, AB, LDAB, B, LDB, INFO ) 00223 * 00224 END IF 00225 RETURN 00226 * 00227 * End of DPBSV 00228 * 00229 END