3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download SPBTRS + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/spbtrs.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/spbtrs.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/spbtrs.f">
21 * SUBROUTINE SPBTRS( UPLO, N, KD, NRHS, AB, LDAB, B, LDB, INFO )
23 * .. Scalar Arguments ..
25 * INTEGER INFO, KD, LDAB, LDB, N, NRHS
27 * .. Array Arguments ..
28 * REAL AB( LDAB, * ), B( LDB, * )
37 *> SPBTRS solves a system of linear equations A*X = B with a symmetric
38 *> positive definite band matrix A using the Cholesky factorization
39 *> A = U**T*U or A = L*L**T computed by SPBTRF.
47 *> UPLO is CHARACTER*1
48 *> = 'U': Upper triangular factor stored in AB;
49 *> = 'L': Lower triangular factor stored in AB.
55 *> The order of the matrix A. N >= 0.
61 *> The number of superdiagonals of the matrix A if UPLO = 'U',
62 *> or the number of subdiagonals if UPLO = 'L'. KD >= 0.
68 *> The number of right hand sides, i.e., the number of columns
69 *> of the matrix B. NRHS >= 0.
74 *> AB is REAL array, dimension (LDAB,N)
75 *> The triangular factor U or L from the Cholesky factorization
76 *> A = U**T*U or A = L*L**T of the band matrix A, stored in the
77 *> first KD+1 rows of the array. The j-th column of U or L is
78 *> stored in the j-th column of the array AB as follows:
79 *> if UPLO ='U', AB(kd+1+i-j,j) = U(i,j) for max(1,j-kd)<=i<=j;
80 *> if UPLO ='L', AB(1+i-j,j) = L(i,j) for j<=i<=min(n,j+kd).
86 *> The leading dimension of the array AB. LDAB >= KD+1.
91 *> B is REAL array, dimension (LDB,NRHS)
92 *> On entry, the right hand side matrix B.
93 *> On exit, the solution matrix X.
99 *> The leading dimension of the array B. LDB >= max(1,N).
105 *> = 0: successful exit
106 *> < 0: if INFO = -i, the i-th argument had an illegal value
112 *> \author Univ. of Tennessee
113 *> \author Univ. of California Berkeley
114 *> \author Univ. of Colorado Denver
117 *> \date November 2011
119 *> \ingroup realOTHERcomputational
121 * =====================================================================
122 SUBROUTINE SPBTRS( UPLO, N, KD, NRHS, AB, LDAB, B, LDB, INFO )
124 * -- LAPACK computational routine (version 3.4.0) --
125 * -- LAPACK is a software package provided by Univ. of Tennessee, --
126 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
129 * .. Scalar Arguments ..
131 INTEGER INFO, KD, LDAB, LDB, N, NRHS
133 * .. Array Arguments ..
134 REAL AB( LDAB, * ), B( LDB, * )
137 * =====================================================================
139 * .. Local Scalars ..
143 * .. External Functions ..
147 * .. External Subroutines ..
148 EXTERNAL STBSV, XERBLA
150 * .. Intrinsic Functions ..
153 * .. Executable Statements ..
155 * Test the input parameters.
158 UPPER = LSAME( UPLO, 'U' )
159 IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
161 ELSE IF( N.LT.0 ) THEN
163 ELSE IF( KD.LT.0 ) THEN
165 ELSE IF( NRHS.LT.0 ) THEN
167 ELSE IF( LDAB.LT.KD+1 ) THEN
169 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
173 CALL XERBLA( 'SPBTRS', -INFO )
177 * Quick return if possible
179 IF( N.EQ.0 .OR. NRHS.EQ.0 )
184 * Solve A*X = B where A = U**T *U.
188 * Solve U**T *X = B, overwriting B with X.
190 CALL STBSV( 'Upper', 'Transpose', 'Non-unit', N, KD, AB,
191 $ LDAB, B( 1, J ), 1 )
193 * Solve U*X = B, overwriting B with X.
195 CALL STBSV( 'Upper', 'No transpose', 'Non-unit', N, KD, AB,
196 $ LDAB, B( 1, J ), 1 )
200 * Solve A*X = B where A = L*L**T.
204 * Solve L*X = B, overwriting B with X.
206 CALL STBSV( 'Lower', 'No transpose', 'Non-unit', N, KD, AB,
207 $ LDAB, B( 1, J ), 1 )
209 * Solve L**T *X = B, overwriting B with X.
211 CALL STBSV( 'Lower', 'Transpose', 'Non-unit', N, KD, AB,
212 $ LDAB, B( 1, J ), 1 )