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
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 )
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 )