157 SUBROUTINE ctbt02( UPLO, TRANS, DIAG, N, KD, NRHS, AB, LDAB, X,
158 $ LDX, B, LDB, WORK, RWORK, RESID )
165 CHARACTER DIAG, TRANS, UPLO
166 INTEGER KD, LDAB, LDB, LDX, N, NRHS
171 COMPLEX AB( LDAB, * ), B( LDB, * ), WORK( * ),
179 parameter( zero = 0.0e+0, one = 1.0e+0 )
183 REAL ANORM, BNORM, EPS, XNORM
187 REAL CLANTB, SCASUM, SLAMCH
188 EXTERNAL lsame, clantb, scasum, slamch
200 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
207 IF( lsame( trans,
'N' ) )
THEN
208 anorm = clantb(
'1', uplo, diag, n, kd, ab, ldab, rwork )
210 anorm = clantb(
'I', uplo, diag, n, kd, ab, ldab, rwork )
215 eps = slamch(
'Epsilon' )
216 IF( anorm.LE.zero )
THEN
226 CALL ccopy( n, x( 1, j ), 1, work, 1 )
227 CALL ctbmv( uplo, trans, diag, n, kd, ab, ldab, work, 1 )
228 CALL caxpy( n, cmplx( -one ), b( 1, j ), 1, work, 1 )
229 bnorm = scasum( n, work, 1 )
230 xnorm = scasum( n, x( 1, j ), 1 )
231 IF( xnorm.LE.zero )
THEN
234 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
subroutine ctbt02(uplo, trans, diag, n, kd, nrhs, ab, ldab, x, ldx, b, ldb, work, rwork, resid)
CTBT02
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine ctbmv(uplo, trans, diag, n, k, a, lda, x, incx)
CTBMV