186 SUBROUTINE stbrfs( 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 REAL AB( LDAB, * ), B( LDB, * ), BERR( * ),
200 $ ferr( * ), work( * ), x( ldx, * )
207 parameter( zero = 0.0e+0 )
209 parameter( one = 1.0e+0 )
212 LOGICAL NOTRAN, NOUNIT, UPPER
214 INTEGER I, J, K, KASE, NZ
215 REAL EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
224 INTRINSIC abs, max, min
229 EXTERNAL lsame, slamch
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(
'STBRFS', -info )
267 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
284 eps = slamch(
'Epsilon' )
285 safmin = slamch(
'Safe minimum' )
296 CALL scopy( n, x( 1, j ), 1, work( n+1 ), 1 )
297 CALL stbmv( uplo, trans, diag, n, kd, ab, ldab, work( n+1 ),
299 CALL saxpy( 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 slacn2( n, work( 2*n+1 ), work( n+1 ), iwork, ferr( j ),
449 CALL stbsv( 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 stbsv( 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 saxpy(n, sa, sx, incx, sy, incy)
SAXPY
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine slacn2(n, v, x, isgn, est, kase, isave)
SLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
subroutine stbmv(uplo, trans, diag, n, k, a, lda, x, incx)
STBMV
subroutine stbrfs(uplo, trans, diag, n, kd, nrhs, ab, ldab, b, ldb, x, ldx, ferr, berr, work, iwork, info)
STBRFS
subroutine stbsv(uplo, trans, diag, n, k, a, lda, x, incx)
STBSV