153 SUBROUTINE ctrt02( UPLO, TRANS, DIAG, N, NRHS, A, LDA, X, LDX, B,
154 $ LDB, WORK, RWORK, RESID )
161 CHARACTER DIAG, TRANS, UPLO
162 INTEGER LDA, LDB, LDX, N, NRHS
167 COMPLEX A( LDA, * ), B( LDB, * ), WORK( * ),
175 parameter( zero = 0.0e+0, one = 1.0e+0 )
179 REAL ANORM, BNORM, EPS, XNORM
183 REAL CLANTR, SCASUM, SLAMCH
184 EXTERNAL lsame, clantr, scasum, slamch
196 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
203 IF( lsame( trans,
'N' ) )
THEN
204 anorm = clantr(
'1', uplo, diag, n, n, a, lda, rwork )
206 anorm = clantr(
'I', uplo, diag, n, n, a, lda, rwork )
211 eps = slamch(
'Epsilon' )
212 IF( anorm.LE.zero )
THEN
222 CALL ccopy( n, x( 1, j ), 1, work, 1 )
223 CALL ctrmv( uplo, trans, diag, n, a, lda, work, 1 )
224 CALL caxpy( n, cmplx( -one ), b( 1, j ), 1, work, 1 )
225 bnorm = scasum( n, work, 1 )
226 xnorm = scasum( n, x( 1, j ), 1 )
227 IF( xnorm.LE.zero )
THEN
230 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
subroutine ctrt02(uplo, trans, diag, n, nrhs, a, lda, x, ldx, b, ldb, work, rwork, resid)
CTRT02
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine ctrmv(uplo, trans, diag, n, a, lda, x, incx)
CTRMV