157 SUBROUTINE ztrt02( 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
168 DOUBLE PRECISION RESID
171 DOUBLE PRECISION RWORK( * )
172 COMPLEX*16 A( lda, * ), B( ldb, * ), WORK( * ),
179 DOUBLE PRECISION ZERO, ONE
180 parameter ( zero = 0.0d+0, one = 1.0d+0 )
184 DOUBLE PRECISION ANORM, BNORM, EPS, XNORM
188 DOUBLE PRECISION DLAMCH, DZASUM, ZLANTR
189 EXTERNAL lsame, dlamch, dzasum, zlantr
195 INTRINSIC dcmplx, max
201 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
208 IF( lsame( trans,
'N' ) )
THEN
209 anorm = zlantr(
'1', uplo, diag, n, n, a, lda, rwork )
211 anorm = zlantr(
'I', uplo, diag, n, n, a, lda, rwork )
216 eps = dlamch(
'Epsilon' )
217 IF( anorm.LE.zero )
THEN
227 CALL zcopy( n, x( 1, j ), 1, work, 1 )
228 CALL ztrmv( uplo, trans, diag, n, a, lda, work, 1 )
229 CALL zaxpy( n, dcmplx( -one ), b( 1, j ), 1, work, 1 )
230 bnorm = dzasum( n, work, 1 )
231 xnorm = dzasum( n, x( 1, j ), 1 )
232 IF( xnorm.LE.zero )
THEN
235 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
subroutine zcopy(N, ZX, INCX, ZY, INCY)
ZCOPY
subroutine ztrt02(UPLO, TRANS, DIAG, N, NRHS, A, LDA, X, LDX, B, LDB, WORK, RWORK, RESID)
ZTRT02
subroutine ztrmv(UPLO, TRANS, DIAG, N, A, LDA, X, INCX)
ZTRMV
subroutine zaxpy(N, ZA, ZX, INCX, ZY, INCY)
ZAXPY