176 SUBROUTINE ctbt03( UPLO, TRANS, DIAG, N, KD, NRHS, AB, LDAB,
177 $ scale, cnorm, tscal, x, ldx, b, ldb, work,
186 CHARACTER diag, trans, uplo
187 INTEGER kd, ldab, ldb, ldx, n, nrhs
188 REAL resid, scale, tscal
192 COMPLEX ab( ldab, * ), b( ldb, * ), work( * ),
201 parameter( one = 1.0e+0, zero = 0.0e+0 )
205 REAL eps, err, smlnum, tnorm, xnorm, xscal
217 INTRINSIC abs, cmplx, max, real
223 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
228 smlnum =
slamch(
'Safe minimum' )
234 IF(
lsame( diag,
'N' ) )
THEN
235 IF(
lsame( uplo,
'U' ) )
THEN
237 tnorm = max( tnorm, tscal*abs( ab( kd+1, j ) )+
242 tnorm = max( tnorm, tscal*abs( ab( 1, j ) )+cnorm( j ) )
247 tnorm = max( tnorm, tscal+cnorm( j ) )
256 CALL
ccopy( n, x( 1, j ), 1, work, 1 )
258 xnorm = max( one, abs( x( ix, j ) ) )
259 xscal = ( one / xnorm ) /
REAL( kd+1 )
260 CALL
csscal( n, xscal, work, 1 )
261 CALL
ctbmv( uplo, trans, diag, n, kd, ab, ldab, work, 1 )
262 CALL
caxpy( n, cmplx( -scale*xscal ), b( 1, j ), 1, work, 1 )
264 err = tscal*abs( work( ix ) )
265 ix =
icamax( n, x( 1, j ), 1 )
266 xnorm = abs( x( ix, j ) )
267 IF( err*smlnum.LE.xnorm )
THEN
274 IF( err*smlnum.LE.tnorm )
THEN
281 resid = max( resid, err )