145 SUBROUTINE ctpt02( UPLO, TRANS, DIAG, N, NRHS, AP, X, LDX, B, LDB,
146 $ WORK, RWORK, RESID )
153 CHARACTER DIAG, TRANS, UPLO
154 INTEGER LDB, LDX, N, NRHS
159 COMPLEX AP( * ), B( LDB, * ), WORK( * ), X( LDX, * )
166 parameter( zero = 0.0e+0, one = 1.0e+0 )
170 REAL ANORM, BNORM, EPS, XNORM
174 REAL CLANTP, SCASUM, SLAMCH
175 EXTERNAL lsame, clantp, scasum, slamch
187 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
194 IF( lsame( trans,
'N' ) )
THEN
195 anorm = clantp(
'1', uplo, diag, n, ap, rwork )
197 anorm = clantp(
'I', uplo, diag, n, ap, rwork )
202 eps = slamch(
'Epsilon' )
203 IF( anorm.LE.zero )
THEN
213 CALL ccopy( n, x( 1, j ), 1, work, 1 )
214 CALL ctpmv( uplo, trans, diag, n, ap, work, 1 )
215 CALL caxpy( n, cmplx( -one ), b( 1, j ), 1, work, 1 )
216 bnorm = scasum( n, work, 1 )
217 xnorm = scasum( n, x( 1, j ), 1 )
218 IF( xnorm.LE.zero )
THEN
221 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
subroutine ctpt02(uplo, trans, diag, n, nrhs, ap, x, ldx, b, ldb, work, rwork, resid)
CTPT02
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine ctpmv(uplo, trans, diag, n, ap, x, incx)
CTPMV