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 )
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
real function scasum(N, CX, INCX)
SCASUM
set ue cd $ADTTMP cat<< EOF > tmp f Program LinearEquations Implicit none Real b(3) integer i
logical function lsame(CA, CB)
LSAME
real function slamch(CMACH)
SLAMCH
set ue cd $ADTTMP cat<< EOF > tmp f Program LinearEquations Implicit none Real j
subroutine ccopy(N, CX, INCX, CY, INCY)
CCOPY
subroutine ctrmv(UPLO, TRANS, DIAG, N, A, LDA, X, INCX)
CTRMV
real function clantr(NORM, UPLO, DIAG, M, N, A, LDA, WORK)
CLANTR returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a trapezoidal or triangular matrix.