203 SUBROUTINE zgbrfs( TRANS, N, KL, KU, NRHS, AB, LDAB, AFB, LDAFB,
204 $ IPIV, B, LDB, X, LDX, FERR, BERR, WORK, RWORK,
213 INTEGER INFO, KL, KU, LDAB, LDAFB, LDB, LDX, N, NRHS
217 DOUBLE PRECISION BERR( * ), FERR( * ), RWORK( * )
218 COMPLEX*16 AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ),
219 $ work( * ), x( ldx, * )
226 PARAMETER ( ITMAX = 5 )
227 DOUBLE PRECISION ZERO
228 parameter( zero = 0.0d+0 )
230 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
232 parameter( two = 2.0d+0 )
233 DOUBLE PRECISION THREE
234 parameter( three = 3.0d+0 )
238 CHARACTER TRANSN, TRANST
239 INTEGER COUNT, I, J, K, KASE, KK, NZ
240 DOUBLE PRECISION EPS, LSTRES, S, SAFE1, SAFE2, SAFMIN, XK
250 INTRINSIC abs, dble, dimag, max, min
254 DOUBLE PRECISION DLAMCH
255 EXTERNAL lsame, dlamch
258 DOUBLE PRECISION CABS1
261 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
268 notran = lsame( trans,
'N' )
269 IF( .NOT.notran .AND. .NOT.lsame( trans,
'T' ) .AND. .NOT.
270 $ lsame( trans,
'C' ) )
THEN
272 ELSE IF( n.LT.0 )
THEN
274 ELSE IF( kl.LT.0 )
THEN
276 ELSE IF( ku.LT.0 )
THEN
278 ELSE IF( nrhs.LT.0 )
THEN
280 ELSE IF( ldab.LT.kl+ku+1 )
THEN
282 ELSE IF( ldafb.LT.2*kl+ku+1 )
THEN
284 ELSE IF( ldb.LT.max( 1, n ) )
THEN
286 ELSE IF( ldx.LT.max( 1, n ) )
THEN
290 CALL xerbla(
'ZGBRFS', -info )
296 IF( n.EQ.0 .OR. nrhs.EQ.0 )
THEN
314 nz = min( kl+ku+2, n+1 )
315 eps = dlamch(
'Epsilon' )
316 safmin = dlamch(
'Safe minimum' )
333 CALL zcopy( n, b( 1, j ), 1, work, 1 )
334 CALL zgbmv( trans, n, n, kl, ku, -cone, ab, ldab, x( 1, j ), 1,
347 rwork( i ) = cabs1( b( i, j ) )
355 xk = cabs1( x( k, j ) )
356 DO 40 i = max( 1, k-ku ), min( n, k+kl )
357 rwork( i ) = rwork( i ) + cabs1( ab( kk+i, k ) )*xk
364 DO 60 i = max( 1, k-ku ), min( n, k+kl )
365 s = s + cabs1( ab( kk+i, k ) )*cabs1( x( i, j ) )
367 rwork( k ) = rwork( k ) + s
372 IF( rwork( i ).GT.safe2 )
THEN
373 s = max( s, cabs1( work( i ) ) / rwork( i ) )
375 s = max( s, ( cabs1( work( i ) )+safe1 ) /
376 $ ( rwork( i )+safe1 ) )
387 IF( berr( j ).GT.eps .AND. two*berr( j ).LE.lstres .AND.
388 $ count.LE.itmax )
THEN
392 CALL zgbtrs( trans, n, kl, ku, 1, afb, ldafb, ipiv, work, n,
394 CALL zaxpy( n, cone, work, 1, x( 1, j ), 1 )
423 IF( rwork( i ).GT.safe2 )
THEN
424 rwork( i ) = cabs1( work( i ) ) + nz*eps*rwork( i )
426 rwork( i ) = cabs1( work( i ) ) + nz*eps*rwork( i ) +
433 CALL zlacn2( n, work( n+1 ), work, ferr( j ), kase, isave )
439 CALL zgbtrs( transt, n, kl, ku, 1, afb, ldafb, ipiv,
442 work( i ) = rwork( i )*work( i )
449 work( i ) = rwork( i )*work( i )
451 CALL zgbtrs( transn, n, kl, ku, 1, afb, ldafb, ipiv,
461 lstres = max( lstres, cabs1( x( i, j ) ) )
464 $ ferr( j ) = ferr( j ) / lstres
subroutine xerbla(srname, info)
subroutine zaxpy(n, za, zx, incx, zy, incy)
ZAXPY
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
subroutine zgbmv(trans, m, n, kl, ku, alpha, a, lda, x, incx, beta, y, incy)
ZGBMV
subroutine zgbrfs(trans, n, kl, ku, nrhs, ab, ldab, afb, ldafb, ipiv, b, ldb, x, ldx, ferr, berr, work, rwork, info)
ZGBRFS
subroutine zgbtrs(trans, n, kl, ku, nrhs, ab, ldab, ipiv, b, ldb, info)
ZGBTRS
subroutine zlacn2(n, v, x, est, kase, isave)
ZLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...