171 SUBROUTINE ztrt03( UPLO, TRANS, DIAG, N, NRHS, A, LDA, SCALE,
172 $ cnorm, tscal, x, ldx, b, ldb, work, resid )
180 CHARACTER diag, trans, uplo
181 INTEGER lda, ldb, ldx, n, nrhs
182 DOUBLE PRECISION resid, scale, tscal
185 DOUBLE PRECISION cnorm( * )
186 COMPLEX*16 a( lda, * ), b( ldb, * ), work( * ),
193 DOUBLE PRECISION one, zero
194 parameter( one = 1.0d+0, zero = 0.0d+0 )
198 DOUBLE PRECISION eps, err, smlnum, tnorm, xnorm, xscal
210 INTRINSIC abs, dble, dcmplx, max
216 IF( n.LE.0 .OR. nrhs.LE.0 )
THEN
221 smlnum =
dlamch(
'Safe minimum' )
227 IF(
lsame( diag,
'N' ) )
THEN
229 tnorm = max( tnorm, tscal*abs( a( j, j ) )+cnorm( j ) )
233 tnorm = max( tnorm, tscal+cnorm( j ) )
242 CALL
zcopy( n, x( 1, j ), 1, work, 1 )
244 xnorm = max( one, abs( x( ix, j ) ) )
245 xscal = ( one / xnorm ) / dble( n )
246 CALL
zdscal( n, xscal, work, 1 )
247 CALL
ztrmv( uplo, trans, diag, n, a, lda, work, 1 )
248 CALL
zaxpy( n, dcmplx( -scale*xscal ), b( 1, j ), 1, work, 1 )
250 err = tscal*abs( work( ix ) )
251 ix =
izamax( n, x( 1, j ), 1 )
252 xnorm = abs( x( ix, j ) )
253 IF( err*smlnum.LE.xnorm )
THEN
260 IF( err*smlnum.LE.tnorm )
THEN
267 resid = max( resid, err )