162 SUBROUTINE ctpt03( UPLO, TRANS, DIAG, N, NRHS, AP, SCALE, CNORM,
163 $ tscal, x, ldx, b, ldb, work, resid )
171 CHARACTER diag, trans, uplo
172 INTEGER ldb, ldx, n, nrhs
173 REAL resid, scale, tscal
177 COMPLEX ap( * ), b( ldb, * ), work( * ), x( ldx, * )
184 parameter( one = 1.0e+0, zero = 0.0e+0 )
188 REAL eps, err, smlnum, tnorm, xnorm, xscal
200 INTRINSIC abs, cmplx, max, real
206 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
211 smlnum =
slamch(
'Safe minimum' )
217 IF(
lsame( diag,
'N' ) )
THEN
218 IF(
lsame( uplo,
'U' ) )
THEN
221 tnorm = max( tnorm, tscal*abs( ap( jj ) )+cnorm( j ) )
227 tnorm = max( tnorm, tscal*abs( ap( jj ) )+cnorm( j ) )
233 tnorm = max( tnorm, tscal+cnorm( j ) )
242 CALL
ccopy( n, x( 1, j ), 1, work, 1 )
244 xnorm = max( one, abs( x( ix, j ) ) )
245 xscal = ( one / xnorm ) /
REAL( n )
246 CALL
csscal( n, xscal, work, 1 )
247 CALL
ctpmv( uplo, trans, diag, n, ap, work, 1 )
248 CALL
caxpy( n, cmplx( -scale*xscal ), b( 1, j ), 1, work, 1 )
250 err = tscal*abs( work( ix ) )
251 ix =
icamax( n, x( 1, j ), 1 )
252 xnorm = abs( x( ix, j ) )
253 IF( err*smlnum.LE.xnorm )
THEN
260 IF( err*smlnum.LE.tnorm )
THEN
267 resid = max( resid, err )