157 SUBROUTINE ctrt02( 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
172 COMPLEX a( lda, * ), b( ldb, * ), work( * ),
180 parameter( zero = 0.0e+0, one = 1.0e+0 )
184 REAL anorm, bnorm, eps, xnorm
201 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
208 IF(
lsame( trans,
'N' ) )
THEN
209 anorm =
clantr(
'1', uplo, diag, n, n, a, lda, rwork )
211 anorm =
clantr(
'I', uplo, diag, n, n, a, lda, rwork )
217 IF( anorm.LE.zero )
THEN
227 CALL
ccopy( n, x( 1, j ), 1, work, 1 )
228 CALL
ctrmv( uplo, trans, diag, n, a, lda, work, 1 )
229 CALL
caxpy( n, cmplx( -one ), b( 1, j ), 1, work, 1 )
230 bnorm =
scasum( n, work, 1 )
231 xnorm =
scasum( n, x( 1, j ), 1 )
232 IF( xnorm.LE.zero )
THEN
235 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )