157 SUBROUTINE ztrt02( UPLO, TRANS, DIAG, N, NRHS, A, LDA, X, LDX, B,
158 $ ldb, work, rwork, resid )
166 CHARACTER diag, trans, uplo
167 INTEGER lda, ldb, ldx, n, nrhs
168 DOUBLE PRECISION resid
171 DOUBLE PRECISION rwork( * )
172 COMPLEX*16 a( lda, * ), b( ldb, * ), work( * ),
179 DOUBLE PRECISION zero, one
180 parameter( zero = 0.0d+0, one = 1.0d+0 )
184 DOUBLE PRECISION anorm, bnorm, eps, xnorm
195 INTRINSIC dcmplx, max
201 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
208 IF(
lsame( trans,
'N' ) )
THEN
209 anorm =
zlantr(
'1', uplo, diag, n, n, a, lda, rwork )
211 anorm =
zlantr(
'I', uplo, diag, n, n, a, lda, rwork )
217 IF( anorm.LE.zero )
THEN
227 CALL
zcopy( n, x( 1, j ), 1, work, 1 )
228 CALL
ztrmv( uplo, trans, diag, n, a, lda, work, 1 )
229 CALL
zaxpy( n, dcmplx( -one ), b( 1, j ), 1, work, 1 )
230 bnorm =
dzasum( n, work, 1 )
231 xnorm =
dzasum( n, x( 1, j ), 1 )
232 IF( xnorm.LE.zero )
THEN
235 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )