153 SUBROUTINE ztrt02( 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
163 DOUBLE PRECISION RESID
166 DOUBLE PRECISION RWORK( * )
167 COMPLEX*16 A( LDA, * ), B( LDB, * ), WORK( * ),
174 DOUBLE PRECISION ZERO, ONE
175 parameter( zero = 0.0d+0, one = 1.0d+0 )
179 DOUBLE PRECISION ANORM, BNORM, EPS, XNORM
183 DOUBLE PRECISION DLAMCH, DZASUM, ZLANTR
184 EXTERNAL lsame, dlamch, dzasum, zlantr
190 INTRINSIC dcmplx, max
196 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
203 IF( lsame( trans,
'N' ) )
THEN
204 anorm = zlantr(
'1', uplo, diag, n, n, a, lda, rwork )
206 anorm = zlantr(
'I', uplo, diag, n, n, a, lda, rwork )
211 eps = dlamch(
'Epsilon' )
212 IF( anorm.LE.zero )
THEN
222 CALL zcopy( n, x( 1, j ), 1, work, 1 )
223 CALL ztrmv( uplo, trans, diag, n, a, lda, work, 1 )
224 CALL zaxpy( n, dcmplx( -one ), b( 1, j ), 1, work, 1 )
225 bnorm = dzasum( n, work, 1 )
226 xnorm = dzasum( n, x( 1, j ), 1 )
227 IF( xnorm.LE.zero )
THEN
230 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
subroutine zaxpy(n, za, zx, incx, zy, incy)
ZAXPY
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
subroutine ztrmv(uplo, trans, diag, n, a, lda, x, incx)
ZTRMV
subroutine ztrt02(uplo, trans, diag, n, nrhs, a, lda, x, ldx, b, ldb, work, rwork, resid)
ZTRT02