1 SUBROUTINE dtbsv ( UPLO, TRANS, DIAG, N, K, A, LDA, X, INCX )
3 INTEGER INCX, K, LDA, N
4 CHARACTER*1 DIAG, TRANS, UPLO
6 DOUBLE PRECISION A( LDA, * ), X( * )
142 DOUBLE PRECISION ZERO
143 parameter( zero = 0.0d+0 )
145 DOUBLE PRECISION TEMP
146 INTEGER I, INFO, IX, J, JX, KPLUS1, KX, L
161 IF ( .NOT.lsame( uplo ,
'U' ).AND.
162 $ .NOT.lsame( uplo ,
'L' ) )
THEN
164 ELSE IF( .NOT.lsame( trans,
'N' ).AND.
165 $ .NOT.lsame( trans,
'T' ).AND.
166 $ .NOT.lsame( trans,
'C' ) )
THEN
168 ELSE IF( .NOT.lsame( diag ,
'U' ).AND.
169 $ .NOT.lsame( diag ,
'N' ) )
THEN
171 ELSE IF( n.LT.0 )
THEN
173 ELSE IF( k.LT.0 )
THEN
175 ELSE IF( lda.LT.( k + 1 ) )
THEN
177 ELSE IF( incx.EQ.0 )
THEN
181 CALL xerbla(
'DTBSV ', info )
190 nounit = lsame( diag,
'N' )
196 kx = 1 - ( n - 1 )*incx
197 ELSE IF( incx.NE.1 )
THEN
204 IF( lsame( trans,
'N' ) )
THEN
208 IF( lsame( uplo,
'U' ) )
THEN
212 IF( x( j ).NE.zero )
THEN
215 $ x( j ) = x( j )/a( kplus1, j )
217 DO 10, i = j - 1, max( 1, j - k ), -1
218 x( i ) = x( i ) - temp*a( l + i, j )
223 kx = kx + ( n - 1 )*incx
227 IF( x( jx ).NE.zero )
THEN
231 $ x( jx ) = x( jx )/a( kplus1, j )
233 DO 30, i = j - 1, max( 1, j - k ), -1
234 x( ix ) = x( ix ) - temp*a( l + i, j )
244 IF( x( j ).NE.zero )
THEN
247 $ x( j ) = x( j )/a( 1, j )
249 DO 50, i = j + 1, min( n, j + k )
250 x( i ) = x( i ) - temp*a( l + i, j )
258 IF( x( jx ).NE.zero )
THEN
262 $ x( jx ) = x( jx )/a( 1, j )
264 DO 70, i = j + 1, min( n, j + k )
265 x( ix ) = x( ix ) - temp*a( l + i, j )
277 IF( lsame( uplo,
'U' ) )
THEN
283 DO 90, i = max( 1, j - k ), j - 1
284 temp = temp - a( l + i, j )*x( i )
287 $ temp = temp/a( kplus1, j )
296 DO 110, i = max( 1, j - k ), j - 1
297 temp = temp - a( l + i, j )*x( ix )
301 $ temp = temp/a( kplus1, j )
313 DO 130, i = min( n, j + k ), j + 1, -1
314 temp = temp - a( l + i, j )*x( i )
317 $ temp = temp/a( 1, j )
321 kx = kx + ( n - 1 )*incx
327 DO 150, i = min( n, j + k ), j + 1, -1
328 temp = temp - a( l + i, j )*x( ix )
332 $ temp = temp/a( 1, j )
subroutine dtbsv(UPLO, TRANS, DIAG, N, K, A, LDA, X, INCX)
subroutine xerbla(SRNAME, INFO)