149 SUBROUTINE ctpt02( UPLO, TRANS, DIAG, N, NRHS, AP, X, LDX, B, LDB,
150 $ work, rwork, resid )
158 CHARACTER diag, trans, uplo
159 INTEGER ldb, ldx, n, nrhs
164 COMPLEX ap( * ),
b( ldb, * ), work( * ),
x( ldx, * )
171 parameter( zero = 0.0e+0, one = 1.0e+0 )
175 REAL anorm, bnorm, eps, xnorm
192 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
199 IF(
lsame( trans,
'N' ) )
THEN
200 anorm =
clantp(
'1', uplo, diag, n, ap, rwork )
202 anorm =
clantp(
'I', uplo, diag, n, ap, rwork )
208 IF( anorm.LE.zero )
THEN
218 CALL
ccopy( n,
x( 1,
j ), 1, work, 1 )
219 CALL
ctpmv( uplo, trans, diag, n, ap, work, 1 )
220 CALL
caxpy( n, cmplx( -one ),
b( 1,
j ), 1, work, 1 )
221 bnorm =
scasum( n, work, 1 )
223 IF( xnorm.LE.zero )
THEN
226 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
subroutine ctpmv(UPLO, TRANS, DIAG, N, AP, X, INCX)
CTPMV
REAL function clantp(NORM, UPLO, DIAG, N, AP, WORK)
CLANTP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a triangular matrix supplied in packed form.
LOGICAL function lsame(CA, CB)
LSAME
REAL function slamch(CMACH)
SLAMCH
subroutine caxpy(N, CA, CX, INCX, CY, INCY)
CAXPY
set ue cd $ADTTMP cat<< EOF > tmp f Program LinearEquations Implicit none Real b(3) integer i
subroutine ctpt02(UPLO, TRANS, DIAG, N, NRHS, AP, X, LDX, B, LDB, WORK, RWORK, RESID)
CTPT02
REAL function scasum(N, CX, INCX)
SCASUM
set ue cd $ADTTMP cat<< EOF > tmp f Program LinearEquations Implicit none Real j
subroutine ccopy(N, CX, INCX, CY, INCY)
CCOPY