107 SUBROUTINE zpot01( UPLO, N, A, LDA, AFAC, LDAFAC, RWORK, RESID )
116 INTEGER lda, ldafac, n
117 DOUBLE PRECISION resid
120 DOUBLE PRECISION rwork( * )
121 COMPLEX*16 a( lda, * ), afac( ldafac, * )
127 DOUBLE PRECISION zero, one
128 parameter( zero = 0.0d+0, one = 1.0d+0 )
132 DOUBLE PRECISION anorm, eps, tr
145 INTRINSIC dble, dimag
159 anorm =
zlanhe(
'1', uplo, n, a, lda, rwork )
160 IF( anorm.LE.zero )
THEN
169 IF( dimag( afac( j, j ) ).NE.zero )
THEN
177 IF(
lsame( uplo,
'U' ) )
THEN
182 tr =
zdotc( k, afac( 1, k ), 1, afac( 1, k ), 1 )
187 CALL
ztrmv(
'Upper',
'Conjugate',
'Non-unit', k-1, afac,
188 $ ldafac, afac( 1, k ), 1 )
201 $ CALL
zher(
'Lower', n-k, one, afac( k+1, k ), 1,
202 $ afac( k+1, k+1 ), ldafac )
207 CALL
zscal( n-k+1, tc, afac( k, k ), 1 )
214 IF(
lsame( uplo,
'U' ) )
THEN
217 afac( i, j ) = afac( i, j ) - a( i, j )
219 afac( j, j ) = afac( j, j ) - dble( a( j, j ) )
223 afac( j, j ) = afac( j, j ) - dble( a( j, j ) )
225 afac( i, j ) = afac( i, j ) - a( i, j )
232 resid =
zlanhe(
'1', uplo, n, afac, ldafac, rwork )
234 resid = ( ( resid / dble( n ) ) / anorm ) / eps