145 SUBROUTINE ztpt02( 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
155 DOUBLE PRECISION RESID
158 DOUBLE PRECISION RWORK( * )
159 COMPLEX*16 AP( * ), B( LDB, * ), WORK( * ), X( LDX, * )
165 DOUBLE PRECISION ZERO, ONE
166 parameter( zero = 0.0d+0, one = 1.0d+0 )
170 DOUBLE PRECISION ANORM, BNORM, EPS, XNORM
174 DOUBLE PRECISION DLAMCH, DZASUM, ZLANTP
175 EXTERNAL lsame, dlamch, dzasum, zlantp
181 INTRINSIC dcmplx, max
187 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
194 IF( lsame( trans,
'N' ) )
THEN
195 anorm = zlantp(
'1', uplo, diag, n, ap, rwork )
197 anorm = zlantp(
'I', uplo, diag, n, ap, rwork )
202 eps = dlamch(
'Epsilon' )
203 IF( anorm.LE.zero )
THEN
213 CALL zcopy( n, x( 1, j ), 1, work, 1 )
214 CALL ztpmv( uplo, trans, diag, n, ap, work, 1 )
215 CALL zaxpy( n, dcmplx( -one ), b( 1, j ), 1, work, 1 )
216 bnorm = dzasum( n, work, 1 )
217 xnorm = dzasum( n, x( 1, j ), 1 )
218 IF( xnorm.LE.zero )
THEN
221 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
subroutine ztpmv(uplo, trans, diag, n, ap, x, incx)
ZTPMV
subroutine ztpt02(uplo, trans, diag, n, nrhs, ap, x, ldx, b, ldb, work, rwork, resid)
ZTPT02