150 SUBROUTINE dtrt02( UPLO, TRANS, DIAG, N, NRHS, A, LDA, X, LDX, B,
159 CHARACTER diag, trans, uplo
160 INTEGER lda, ldb, ldx, n, nrhs
161 DOUBLE PRECISION resid
164 DOUBLE PRECISION a( lda, * ), b( ldb, * ), work( * ),
171 DOUBLE PRECISION zero, one
172 parameter( zero = 0.0d+0, one = 1.0d+0 )
176 DOUBLE PRECISION anorm, bnorm, eps, xnorm
193 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
200 IF(
lsame( trans,
'N' ) )
THEN
201 anorm =
dlantr(
'1', uplo, diag, n, n, a, lda, work )
203 anorm =
dlantr(
'I', uplo, diag, n, n, a, lda, work )
209 IF( anorm.LE.zero )
THEN
219 CALL
dcopy( n, x( 1, j ), 1, work, 1 )
220 CALL
dtrmv( uplo, trans, diag, n, a, lda, work, 1 )
221 CALL
daxpy( n, -one, b( 1, j ), 1, work, 1 )
222 bnorm =
dasum( n, work, 1 )
223 xnorm =
dasum( n, x( 1, j ), 1 )
224 IF( xnorm.LE.zero )
THEN
227 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )