149 SUBROUTINE ctpt02( UPLO, TRANS, DIAG, N, NRHS, AP, X, LDX, B, LDB,
150 $ work, rwork, resid )
158 CHARACTER DIAG, TRANS, UPLO
159 INTEGER LDB, LDX, N, NRHS
164 COMPLEX AP( * ), B( ldb, * ), WORK( * ), X( ldx, * )
171 parameter ( zero = 0.0e+0, one = 1.0e+0 )
175 REAL ANORM, BNORM, EPS, XNORM
179 REAL CLANTP, SCASUM, SLAMCH
180 EXTERNAL lsame, clantp, scasum, slamch
192 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
199 IF( lsame( trans,
'N' ) )
THEN
200 anorm = clantp(
'1', uplo, diag, n, ap, rwork )
202 anorm = clantp(
'I', uplo, diag, n, ap, rwork )
207 eps = slamch(
'Epsilon' )
208 IF( anorm.LE.zero )
THEN
218 CALL ccopy( n, x( 1, j ), 1, work, 1 )
219 CALL ctpmv( uplo, trans, diag, n, ap, work, 1 )
220 CALL caxpy( n, cmplx( -one ), b( 1, j ), 1, work, 1 )
221 bnorm = scasum( n, work, 1 )
222 xnorm = scasum( n, x( 1, j ), 1 )
223 IF( xnorm.LE.zero )
THEN
226 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
subroutine ctpmv(UPLO, TRANS, DIAG, N, AP, X, INCX)
CTPMV
subroutine ccopy(N, CX, INCX, CY, INCY)
CCOPY
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