186 SUBROUTINE dtbrfs( UPLO, TRANS, DIAG, N, KD, NRHS, AB, LDAB, B,
187 $ LDB, X, LDX, FERR, BERR, WORK, IWORK, INFO )
194 CHARACTER DIAG, TRANS, UPLO
195 INTEGER INFO, KD, LDAB, LDB, LDX, N, NRHS
199 DOUBLE PRECISION AB( LDAB, * ), B( LDB, * ), BERR( * ),
200 $ ferr( * ), work( * ), x( ldx, * )
206 DOUBLE PRECISION ZERO
207 parameter( zero = 0.0d+0 )
209 parameter( one = 1.0d+0 )
212 LOGICAL NOTRAN, NOUNIT, UPPER
214 INTEGER I, J, K, KASE, NZ
215 DOUBLE PRECISION EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
224 INTRINSIC abs, max, min
228 DOUBLE PRECISION DLAMCH
229 EXTERNAL lsame, dlamch
236 upper = lsame( uplo,
'U' )
237 notran = lsame( trans,
'N' )
238 nounit = lsame( diag,
'N' )
240 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
242 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans,
'T' ) .AND. .NOT.
243 $ lsame( trans,
'C' ) )
THEN
245 ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag,
'U' ) )
THEN
247 ELSE IF( n.LT.0 )
THEN
249 ELSE IF( kd.LT.0 )
THEN
251 ELSE IF( nrhs.LT.0 )
THEN
253 ELSE IF( ldab.LT.kd+1 )
THEN
255 ELSE IF( ldb.LT.max( 1, n ) )
THEN
257 ELSE IF( ldx.LT.max( 1, n ) )
THEN
261 CALL xerbla(
'DTBRFS', -info )
267 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
284 eps = dlamch(
'Epsilon' )
285 safmin = dlamch(
'Safe minimum' )
296 CALL dcopy( n, x( 1, j ), 1, work( n+1 ), 1 )
297 CALL dtbmv( uplo, trans, diag, n, kd, ab, ldab, work( n+1 ),
299 CALL daxpy( n, -one, b( 1, j ), 1, work( n+1 ), 1 )
311 work( i ) = abs( b( i, j ) )
321 xk = abs( x( k, j ) )
322 DO 30 i = max( 1, k-kd ), k
323 work( i ) = work( i ) +
324 $ abs( ab( kd+1+i-k, k ) )*xk
329 xk = abs( x( k, j ) )
330 DO 50 i = max( 1, k-kd ), k - 1
331 work( i ) = work( i ) +
332 $ abs( ab( kd+1+i-k, k ) )*xk
334 work( k ) = work( k ) + xk
340 xk = abs( x( k, j ) )
341 DO 70 i = k, min( n, k+kd )
342 work( i ) = work( i ) + abs( ab( 1+i-k, k ) )*xk
347 xk = abs( x( k, j ) )
348 DO 90 i = k + 1, min( n, k+kd )
349 work( i ) = work( i ) + abs( ab( 1+i-k, k ) )*xk
351 work( k ) = work( k ) + xk
363 DO 110 i = max( 1, k-kd ), k
364 s = s + abs( ab( kd+1+i-k, k ) )*
367 work( k ) = work( k ) + s
372 DO 130 i = max( 1, k-kd ), k - 1
373 s = s + abs( ab( kd+1+i-k, k ) )*
376 work( k ) = work( k ) + s
383 DO 150 i = k, min( n, k+kd )
384 s = s + abs( ab( 1+i-k, k ) )*abs( x( i, j ) )
386 work( k ) = work( k ) + s
391 DO 170 i = k + 1, min( n, k+kd )
392 s = s + abs( ab( 1+i-k, k ) )*abs( x( i, j ) )
394 work( k ) = work( k ) + s
401 IF( work( i ).GT.safe2 )
THEN
402 s = max( s, abs( work( n+i ) ) / work( i ) )
404 s = max( s, ( abs( work( n+i ) )+safe1 ) /
405 $ ( work( i )+safe1 ) )
433 IF( work( i ).GT.safe2 )
THEN
434 work( i ) = abs( work( n+i ) ) + nz*eps*work( i )
436 work( i ) = abs( work( n+i ) ) + nz*eps*work( i ) + safe1
442 CALL dlacn2( n, work( 2*n+1 ), work( n+1 ), iwork, ferr( j ),
449 CALL dtbsv( uplo, transt, diag, n, kd, ab, ldab,
452 work( n+i ) = work( i )*work( n+i )
459 work( n+i ) = work( i )*work( n+i )
461 CALL dtbsv( uplo, trans, diag, n, kd, ab, ldab,
471 lstres = max( lstres, abs( x( i, j ) ) )
474 $ ferr( j ) = ferr( j ) / lstres
subroutine xerbla(srname, info)
subroutine daxpy(n, da, dx, incx, dy, incy)
DAXPY
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dlacn2(n, v, x, isgn, est, kase, isave)
DLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
subroutine dtbmv(uplo, trans, diag, n, k, a, lda, x, incx)
DTBMV
subroutine dtbrfs(uplo, trans, diag, n, kd, nrhs, ab, ldab, b, ldb, x, ldx, ferr, berr, work, iwork, info)
DTBRFS
subroutine dtbsv(uplo, trans, diag, n, k, a, lda, x, incx)
DTBSV