LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine cpbtrs ( character  UPLO,
integer  N,
integer  KD,
integer  NRHS,
complex, dimension( ldab, * )  AB,
integer  LDAB,
complex, dimension( ldb, * )  B,
integer  LDB,
integer  INFO 
)

CPBTRS

Download CPBTRS + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 CPBTRS solves a system of linear equations A*X = B with a Hermitian
 positive definite band matrix A using the Cholesky factorization
 A = U**H*U or A = L*L**H computed by CPBTRF.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          = 'U':  Upper triangular factor stored in AB;
          = 'L':  Lower triangular factor stored in AB.
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]KD
          KD is INTEGER
          The number of superdiagonals of the matrix A if UPLO = 'U',
          or the number of subdiagonals if UPLO = 'L'.  KD >= 0.
[in]NRHS
          NRHS is INTEGER
          The number of right hand sides, i.e., the number of columns
          of the matrix B.  NRHS >= 0.
[in]AB
          AB is COMPLEX array, dimension (LDAB,N)
          The triangular factor U or L from the Cholesky factorization
          A = U**H*U or A = L*L**H of the band matrix A, stored in the
          first KD+1 rows of the array.  The j-th column of U or L is
          stored in the j-th column of the array AB as follows:
          if UPLO ='U', AB(kd+1+i-j,j) = U(i,j) for max(1,j-kd)<=i<=j;
          if UPLO ='L', AB(1+i-j,j)    = L(i,j) for j<=i<=min(n,j+kd).
[in]LDAB
          LDAB is INTEGER
          The leading dimension of the array AB.  LDAB >= KD+1.
[in,out]B
          B is COMPLEX array, dimension (LDB,NRHS)
          On entry, the right hand side matrix B.
          On exit, the solution matrix X.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,N).
[out]INFO
          INFO is INTEGER
          = 0:  successful exit
          < 0:  if INFO = -i, the i-th argument had an illegal value
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 123 of file cpbtrs.f.

123 *
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..--
127 * November 2011
128 *
129 * .. Scalar Arguments ..
130  CHARACTER uplo
131  INTEGER info, kd, ldab, ldb, n, nrhs
132 * ..
133 * .. Array Arguments ..
134  COMPLEX ab( ldab, * ), b( ldb, * )
135 * ..
136 *
137 * =====================================================================
138 *
139 * .. Local Scalars ..
140  LOGICAL upper
141  INTEGER j
142 * ..
143 * .. External Functions ..
144  LOGICAL lsame
145  EXTERNAL lsame
146 * ..
147 * .. External Subroutines ..
148  EXTERNAL ctbsv, xerbla
149 * ..
150 * .. Intrinsic Functions ..
151  INTRINSIC max
152 * ..
153 * .. Executable Statements ..
154 *
155 * Test the input parameters.
156 *
157  info = 0
158  upper = lsame( uplo, 'U' )
159  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
160  info = -1
161  ELSE IF( n.LT.0 ) THEN
162  info = -2
163  ELSE IF( kd.LT.0 ) THEN
164  info = -3
165  ELSE IF( nrhs.LT.0 ) THEN
166  info = -4
167  ELSE IF( ldab.LT.kd+1 ) THEN
168  info = -6
169  ELSE IF( ldb.LT.max( 1, n ) ) THEN
170  info = -8
171  END IF
172  IF( info.NE.0 ) THEN
173  CALL xerbla( 'CPBTRS', -info )
174  RETURN
175  END IF
176 *
177 * Quick return if possible
178 *
179  IF( n.EQ.0 .OR. nrhs.EQ.0 )
180  $ RETURN
181 *
182  IF( upper ) THEN
183 *
184 * Solve A*X = B where A = U**H *U.
185 *
186  DO 10 j = 1, nrhs
187 *
188 * Solve U**H *X = B, overwriting B with X.
189 *
190  CALL ctbsv( 'Upper', 'Conjugate transpose', 'Non-unit', n,
191  $ kd, ab, ldab, b( 1, j ), 1 )
192 *
193 * Solve U*X = B, overwriting B with X.
194 *
195  CALL ctbsv( 'Upper', 'No transpose', 'Non-unit', n, kd, ab,
196  $ ldab, b( 1, j ), 1 )
197  10 CONTINUE
198  ELSE
199 *
200 * Solve A*X = B where A = L*L**H.
201 *
202  DO 20 j = 1, nrhs
203 *
204 * Solve L*X = B, overwriting B with X.
205 *
206  CALL ctbsv( 'Lower', 'No transpose', 'Non-unit', n, kd, ab,
207  $ ldab, b( 1, j ), 1 )
208 *
209 * Solve L**H *X = B, overwriting B with X.
210 *
211  CALL ctbsv( 'Lower', 'Conjugate transpose', 'Non-unit', n,
212  $ kd, ab, ldab, b( 1, j ), 1 )
213  20 CONTINUE
214  END IF
215 *
216  RETURN
217 *
218 * End of CPBTRS
219 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine ctbsv(UPLO, TRANS, DIAG, N, K, A, LDA, X, INCX)
CTBSV
Definition: ctbsv.f:191
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: