185 SUBROUTINE dpbrfs( UPLO, N, KD, NRHS, AB, LDAB, AFB, LDAFB, B,
186 $ LDB, X, LDX, FERR, BERR, WORK, IWORK, INFO )
194 INTEGER INFO, KD, LDAB, LDAFB, LDB, LDX, N, NRHS
198 DOUBLE PRECISION AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ),
199 $ berr( * ), ferr( * ), work( * ), x( ldx, * )
206 parameter( itmax = 5 )
207 DOUBLE PRECISION ZERO
208 parameter( zero = 0.0d+0 )
210 parameter( one = 1.0d+0 )
212 parameter( two = 2.0d+0 )
213 DOUBLE PRECISION THREE
214 parameter( three = 3.0d+0 )
218 INTEGER COUNT, I, J, K, KASE, L, NZ
219 DOUBLE PRECISION EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
229 INTRINSIC abs, max, min
233 DOUBLE PRECISION DLAMCH
234 EXTERNAL lsame, dlamch
241 upper = lsame( uplo,
'U' )
242 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
244 ELSE IF( n.LT.0 )
THEN
246 ELSE IF( kd.LT.0 )
THEN
248 ELSE IF( nrhs.LT.0 )
THEN
250 ELSE IF( ldab.LT.kd+1 )
THEN
252 ELSE IF( ldafb.LT.kd+1 )
THEN
254 ELSE IF( ldb.LT.max( 1, n ) )
THEN
256 ELSE IF( ldx.LT.max( 1, n ) )
THEN
260 CALL xerbla(
'DPBRFS', -info )
266 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
276 nz = min( n+1, 2*kd+2 )
277 eps = dlamch(
'Epsilon' )
278 safmin = dlamch(
'Safe minimum' )
294 CALL dcopy( n, b( 1, j ), 1, work( n+1 ), 1 )
295 CALL dsbmv( uplo, n, kd, -one, ab, ldab, x( 1, j ), 1, one,
308 work( i ) = abs( b( i, j ) )
316 xk = abs( x( k, j ) )
318 DO 40 i = max( 1, k-kd ), k - 1
319 work( i ) = work( i ) + abs( ab( l+i, k ) )*xk
320 s = s + abs( ab( l+i, k ) )*abs( x( i, j ) )
322 work( k ) = work( k ) + abs( ab( kd+1, k ) )*xk + s
327 xk = abs( x( k, j ) )
328 work( k ) = work( k ) + abs( ab( 1, k ) )*xk
330 DO 60 i = k + 1, min( n, k+kd )
331 work( i ) = work( i ) + abs( ab( l+i, k ) )*xk
332 s = s + abs( ab( l+i, k ) )*abs( x( i, j ) )
334 work( k ) = work( k ) + s
339 IF( work( i ).GT.safe2 )
THEN
340 s = max( s, abs( work( n+i ) ) / work( i ) )
342 s = max( s, ( abs( work( n+i ) )+safe1 ) /
343 $ ( work( i )+safe1 ) )
354 IF( berr( j ).GT.eps .AND. two*berr( j ).LE.lstres .AND.
355 $ count.LE.itmax )
THEN
359 CALL dpbtrs( uplo, n, kd, 1, afb, ldafb, work( n+1 ), n,
361 CALL daxpy( n, one, work( n+1 ), 1, x( 1, j ), 1 )
390 IF( work( i ).GT.safe2 )
THEN
391 work( i ) = abs( work( n+i ) ) + nz*eps*work( i )
393 work( i ) = abs( work( n+i ) ) + nz*eps*work( i ) + safe1
399 CALL dlacn2( n, work( 2*n+1 ), work( n+1 ), iwork,
407 CALL dpbtrs( uplo, n, kd, 1, afb, ldafb, work( n+1 ),
411 work( n+i ) = work( n+i )*work( i )
413 ELSE IF( kase.EQ.2 )
THEN
418 work( n+i ) = work( n+i )*work( i )
420 CALL dpbtrs( uplo, n, kd, 1, afb, ldafb, work( n+1 ),
431 lstres = max( lstres, abs( x( i, j ) ) )
434 $ ferr( j ) = ferr( j ) / lstres
subroutine dpbrfs(uplo, n, kd, nrhs, ab, ldab, afb, ldafb, b, ldb, x, ldx, ferr, berr, work, iwork, info)
DPBRFS