161 SUBROUTINE ctbt02( 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
176 COMPLEX ab( ldab, * ), b( ldb, * ), work( * ),
184 parameter( zero = 0.0e+0, one = 1.0e+0 )
188 REAL anorm, bnorm, eps, xnorm
205 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
212 IF(
lsame( trans,
'N' ) )
THEN
213 anorm =
clantb(
'1', uplo, diag, n, kd, ab, ldab, rwork )
215 anorm =
clantb(
'I', uplo, diag, n, kd, ab, ldab, rwork )
221 IF( anorm.LE.zero )
THEN
231 CALL
ccopy( n, x( 1, j ), 1, work, 1 )
232 CALL
ctbmv( uplo, trans, diag, n, kd, ab, ldab, work, 1 )
233 CALL
caxpy( n, cmplx( -one ), b( 1, j ), 1, work, 1 )
234 bnorm =
scasum( n, work, 1 )
235 xnorm =
scasum( n, x( 1, j ), 1 )
236 IF( xnorm.LE.zero )
THEN
239 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )