202 SUBROUTINE sgbrfs( TRANS, N, KL, KU, NRHS, AB, LDAB, AFB, LDAFB,
203 $ IPIV, B, LDB, X, LDX, FERR, BERR, WORK, IWORK,
212 INTEGER INFO, KL, KU, LDAB, LDAFB, LDB, LDX, N, NRHS
215 INTEGER IPIV( * ), IWORK( * )
216 REAL AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ),
217 $ berr( * ), ferr( * ), work( * ), x( ldx, * )
224 PARAMETER ( ITMAX = 5 )
226 parameter( zero = 0.0e+0 )
228 parameter( one = 1.0e+0 )
230 parameter( two = 2.0e+0 )
232 parameter( three = 3.0e+0 )
237 INTEGER COUNT, I, J, K, KASE, KK, NZ
238 REAL EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
247 INTRINSIC abs, max, min
252 EXTERNAL lsame, slamch
259 notran = lsame( trans,
'N' )
260 IF( .NOT.notran .AND. .NOT.lsame( trans,
'T' ) .AND. .NOT.
261 $ lsame( trans,
'C' ) )
THEN
263 ELSE IF( n.LT.0 )
THEN
265 ELSE IF( kl.LT.0 )
THEN
267 ELSE IF( ku.LT.0 )
THEN
269 ELSE IF( nrhs.LT.0 )
THEN
271 ELSE IF( ldab.LT.kl+ku+1 )
THEN
273 ELSE IF( ldafb.LT.2*kl+ku+1 )
THEN
275 ELSE IF( ldb.LT.max( 1, n ) )
THEN
277 ELSE IF( ldx.LT.max( 1, n ) )
THEN
281 CALL xerbla(
'SGBRFS', -info )
287 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
303 nz = min( kl+ku+2, n+1 )
304 eps = slamch(
'Epsilon' )
305 safmin = slamch(
'Safe minimum' )
322 CALL scopy( n, b( 1, j ), 1, work( n+1 ), 1 )
323 CALL sgbmv( trans, n, n, kl, ku, -one, ab, ldab, x( 1, j ), 1,
324 $ one, work( n+1 ), 1 )
336 work( i ) = abs( b( i, j ) )
344 xk = abs( x( k, j ) )
345 DO 40 i = max( 1, k-ku ), min( n, k+kl )
346 work( i ) = work( i ) + abs( ab( kk+i, k ) )*xk
353 DO 60 i = max( 1, k-ku ), min( n, k+kl )
354 s = s + abs( ab( kk+i, k ) )*abs( x( i, j ) )
356 work( k ) = work( k ) + s
361 IF( work( i ).GT.safe2 )
THEN
362 s = max( s, abs( work( n+i ) ) / work( i ) )
364 s = max( s, ( abs( work( n+i ) )+safe1 ) /
365 $ ( work( i )+safe1 ) )
376 IF( berr( j ).GT.eps .AND. two*berr( j ).LE.lstres .AND.
377 $ count.LE.itmax )
THEN
381 CALL sgbtrs( trans, n, kl, ku, 1, afb, ldafb, ipiv,
382 $ work( n+1 ), n, info )
383 CALL saxpy( n, one, work( n+1 ), 1, x( 1, j ), 1 )
412 IF( work( i ).GT.safe2 )
THEN
413 work( i ) = abs( work( n+i ) ) + nz*eps*work( i )
415 work( i ) = abs( work( n+i ) ) + nz*eps*work( i ) + safe1
421 CALL slacn2( n, work( 2*n+1 ), work( n+1 ), iwork, ferr( j ),
428 CALL sgbtrs( transt, n, kl, ku, 1, afb, ldafb, ipiv,
429 $ work( n+1 ), n, info )
431 work( n+i ) = work( n+i )*work( i )
438 work( n+i ) = work( n+i )*work( i )
440 CALL sgbtrs( trans, n, kl, ku, 1, afb, ldafb, ipiv,
441 $ work( n+1 ), n, info )
450 lstres = max( lstres, abs( x( i, j ) ) )
453 $ 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 sgbmv(trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy)
SGBMV
subroutine sgbrfs(trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, b, ldb, x, ldx, ferr, berr, work, iwork, info)
SGBRFS
subroutine sgbtrs(trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info)
SGBTRS
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...