202 SUBROUTINE dgbrfs( 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 DOUBLE PRECISION AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ),
217 $ berr( * ), ferr( * ), work( * ), x( ldx, * )
224 PARAMETER ( ITMAX = 5 )
225 DOUBLE PRECISION ZERO
226 parameter( zero = 0.0d+0 )
228 parameter( one = 1.0d+0 )
230 parameter( two = 2.0d+0 )
231 DOUBLE PRECISION THREE
232 parameter( three = 3.0d+0 )
237 INTEGER COUNT, I, J, K, KASE, KK, NZ
238 DOUBLE PRECISION EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
247 INTRINSIC abs, max, min
251 DOUBLE PRECISION DLAMCH
252 EXTERNAL lsame, dlamch
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(
'DGBRFS', -info )
287 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
303 nz = min( kl+ku+2, n+1 )
304 eps = dlamch(
'Epsilon' )
305 safmin = dlamch(
'Safe minimum' )
322 CALL dcopy( n, b( 1, j ), 1, work( n+1 ), 1 )
323 CALL dgbmv( 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 dgbtrs( trans, n, kl, ku, 1, afb, ldafb, ipiv,
382 $ work( n+1 ), n, info )
383 CALL daxpy( 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 dlacn2( n, work( 2*n+1 ), work( n+1 ), iwork, ferr( j ),
428 CALL dgbtrs( 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 dgbtrs( 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 daxpy(n, da, dx, incx, dy, incy)
DAXPY
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dgbmv(trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy)
DGBMV
subroutine dgbrfs(trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, b, ldb, x, ldx, ferr, berr, work, iwork, info)
DGBRFS
subroutine dgbtrs(trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info)
DGBTRS
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...