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
188 REAL CLANTR, SCASUM, SLAMCH
189 EXTERNAL lsame, clantr, scasum, slamch
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 )
216 eps = slamch(
'Epsilon' )
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 )
subroutine ctrt02(UPLO, TRANS, DIAG, N, NRHS, A, LDA, X, LDX, B, LDB, WORK, RWORK, RESID)
CTRT02
subroutine ctrmv(UPLO, TRANS, DIAG, N, A, LDA, X, INCX)
CTRMV
subroutine ccopy(N, CX, INCX, CY, INCY)
CCOPY
subroutine caxpy(N, CA, CX, INCX, CY, INCY)
CAXPY