149 SUBROUTINE ztpt02( 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
160 DOUBLE PRECISION RESID
163 DOUBLE PRECISION RWORK( * )
164 COMPLEX*16 AP( * ), B( ldb, * ), WORK( * ), X( ldx, * )
170 DOUBLE PRECISION ZERO, ONE
171 parameter ( zero = 0.0d+0, one = 1.0d+0 )
175 DOUBLE PRECISION ANORM, BNORM, EPS, XNORM
179 DOUBLE PRECISION DLAMCH, DZASUM, ZLANTP
180 EXTERNAL lsame, dlamch, dzasum, zlantp
186 INTRINSIC dcmplx, max
192 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
199 IF( lsame( trans,
'N' ) )
THEN
200 anorm = zlantp(
'1', uplo, diag, n, ap, rwork )
202 anorm = zlantp(
'I', uplo, diag, n, ap, rwork )
207 eps = dlamch(
'Epsilon' )
208 IF( anorm.LE.zero )
THEN
218 CALL zcopy( n, x( 1, j ), 1, work, 1 )
219 CALL ztpmv( uplo, trans, diag, n, ap, work, 1 )
220 CALL zaxpy( n, dcmplx( -one ), b( 1, j ), 1, work, 1 )
221 bnorm = dzasum( n, work, 1 )
222 xnorm = dzasum( n, x( 1, j ), 1 )
223 IF( xnorm.LE.zero )
THEN
226 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
subroutine zcopy(N, ZX, INCX, ZY, INCY)
ZCOPY
subroutine ztpt02(UPLO, TRANS, DIAG, N, NRHS, AP, X, LDX, B, LDB, WORK, RWORK, RESID)
ZTPT02
subroutine ztpmv(UPLO, TRANS, DIAG, N, AP, X, INCX)
ZTPMV
subroutine zaxpy(N, ZA, ZX, INCX, ZY, INCY)
ZAXPY