161 SUBROUTINE ztbt02( UPLO, TRANS, DIAG, N, KD, NRHS, AB, LDAB, X,
162 $ ldx, b, ldb, work, rwork, resid )
170 CHARACTER DIAG, TRANS, UPLO
171 INTEGER KD, LDAB, LDB, LDX, N, NRHS
172 DOUBLE PRECISION RESID
175 DOUBLE PRECISION RWORK( * )
176 COMPLEX*16 AB( ldab, * ), B( ldb, * ), WORK( * ),
183 DOUBLE PRECISION ZERO, ONE
184 parameter ( zero = 0.0d+0, one = 1.0d+0 )
188 DOUBLE PRECISION ANORM, BNORM, EPS, XNORM
192 DOUBLE PRECISION DLAMCH, DZASUM, ZLANTB
193 EXTERNAL lsame, dlamch, dzasum, zlantb
199 INTRINSIC dcmplx, max
205 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
212 IF( lsame( trans,
'N' ) )
THEN
213 anorm = zlantb(
'1', uplo, diag, n, kd, ab, ldab, rwork )
215 anorm = zlantb(
'I', uplo, diag, n, kd, ab, ldab, rwork )
220 eps = dlamch(
'Epsilon' )
221 IF( anorm.LE.zero )
THEN
231 CALL zcopy( n, x( 1, j ), 1, work, 1 )
232 CALL ztbmv( uplo, trans, diag, n, kd, ab, ldab, work, 1 )
233 CALL zaxpy( n, dcmplx( -one ), b( 1, j ), 1, work, 1 )
234 bnorm = dzasum( n, work, 1 )
235 xnorm = dzasum( n, x( 1, j ), 1 )
236 IF( xnorm.LE.zero )
THEN
239 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
subroutine ztbt02(UPLO, TRANS, DIAG, N, KD, NRHS, AB, LDAB, X, LDX, B, LDB, WORK, RWORK, RESID)
ZTBT02
subroutine zcopy(N, ZX, INCX, ZY, INCY)
ZCOPY
subroutine ztbmv(UPLO, TRANS, DIAG, N, K, A, LDA, X, INCX)
ZTBMV
subroutine zaxpy(N, ZA, ZX, INCX, ZY, INCY)
ZAXPY