160 SUBROUTINE ctpt03( UPLO, TRANS, DIAG, N, NRHS, AP, SCALE, CNORM,
161 $ TSCAL, X, LDX, B, LDB, WORK, RESID )
168 CHARACTER DIAG, TRANS, UPLO
169 INTEGER LDB, LDX, N, NRHS
170 REAL RESID, SCALE, TSCAL
174 COMPLEX AP( * ), B( LDB, * ), WORK( * ), X( LDX, * )
181 parameter( one = 1.0e+0, zero = 0.0e+0 )
185 REAL EPS, ERR, SMLNUM, TNORM, XNORM, XSCAL
191 EXTERNAL lsame, icamax, slamch
197 INTRINSIC abs, cmplx, max, real
203 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
207 eps = slamch(
'Epsilon' )
208 smlnum = slamch(
'Safe minimum' )
214 IF( lsame( diag,
'N' ) )
THEN
215 IF( lsame( uplo,
'U' ) )
THEN
218 tnorm = max( tnorm, tscal*abs( ap( jj ) )+cnorm( j ) )
224 tnorm = max( tnorm, tscal*abs( ap( jj ) )+cnorm( j ) )
230 tnorm = max( tnorm, tscal+cnorm( j ) )
239 CALL ccopy( n, x( 1, j ), 1, work, 1 )
240 ix = icamax( n, work, 1 )
241 xnorm = max( one, abs( x( ix, j ) ) )
242 xscal = ( one / xnorm ) / real( n )
243 CALL csscal( n, xscal, work, 1 )
244 CALL ctpmv( uplo, trans, diag, n, ap, work, 1 )
245 CALL caxpy( n, cmplx( -scale*xscal ), b( 1, j ), 1, work, 1 )
246 ix = icamax( n, work, 1 )
247 err = tscal*abs( work( ix ) )
248 ix = icamax( n, x( 1, j ), 1 )
249 xnorm = abs( x( ix, j ) )
250 IF( err*smlnum.LE.xnorm )
THEN
257 IF( err*smlnum.LE.tnorm )
THEN
264 resid = max( resid, err )
subroutine ctpt03(uplo, trans, diag, n, nrhs, ap, scale, cnorm, tscal, x, ldx, b, ldb, work, resid)
CTPT03
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine csscal(n, sa, cx, incx)
CSSCAL
subroutine ctpmv(uplo, trans, diag, n, ap, x, incx)
CTPMV