134 SUBROUTINE zpst01( UPLO, N, A, LDA, AFAC, LDAFAC, PERM, LDPERM,
135 $ PIV, RWORK, RESID, RANK )
142 DOUBLE PRECISION RESID
143 INTEGER LDA, LDAFAC, LDPERM, N, RANK
147 COMPLEX*16 A( LDA, * ), AFAC( LDAFAC, * ),
149 DOUBLE PRECISION RWORK( * )
156 DOUBLE PRECISION ZERO, ONE
157 parameter( zero = 0.0d+0, one = 1.0d+0 )
159 parameter( czero = ( 0.0d+0, 0.0d+0 ) )
163 DOUBLE PRECISION ANORM, EPS, TR
168 DOUBLE PRECISION DLAMCH, ZLANHE
170 EXTERNAL zdotc, dlamch, zlanhe, lsame
176 INTRINSIC dble, dconjg, dimag
189 eps = dlamch(
'Epsilon' )
190 anorm = zlanhe(
'1', uplo, n, a, lda, rwork )
191 IF( anorm.LE.zero )
THEN
200 IF( dimag( afac( j, j ) ).NE.zero )
THEN
208 IF( lsame( uplo,
'U' ) )
THEN
211 DO 120 j = rank + 1, n
212 DO 110 i = rank + 1, j
222 tr = dble( zdotc( k, afac( 1, k ), 1, afac( 1, k ), 1 ) )
227 CALL ztrmv(
'Upper',
'Conjugate',
'Non-unit', k-1, afac,
228 $ ldafac, afac( 1, k ), 1 )
237 DO 150 j = rank + 1, n
249 $
CALL zher(
'Lower', n-k, one, afac( k+1, k ), 1,
250 $ afac( k+1, k+1 ), ldafac )
255 CALL zscal( n-k+1, tc, afac( k, k ), 1 )
262 IF( lsame( uplo,
'U' ) )
THEN
266 IF( piv( i ).LE.piv( j ) )
THEN
268 perm( piv( i ), piv( j ) ) = afac( i, j )
270 perm( piv( i ), piv( j ) ) = dconjg( afac( j, i ) )
281 IF( piv( i ).GE.piv( j ) )
THEN
283 perm( piv( i ), piv( j ) ) = afac( i, j )
285 perm( piv( i ), piv( j ) ) = dconjg( afac( j, i ) )
295 IF( lsame( uplo,
'U' ) )
THEN
298 perm( i, j ) = perm( i, j ) - a( i, j )
300 perm( j, j ) = perm( j, j ) - dble( a( j, j ) )
304 perm( j, j ) = perm( j, j ) - dble( a( j, j ) )
306 perm( i, j ) = perm( i, j ) - a( i, j )
314 resid = zlanhe(
'1', uplo, n, perm, ldafac, rwork )
316 resid = ( ( resid / dble( n ) ) / anorm ) / eps
subroutine zher(uplo, n, alpha, x, incx, a, lda)
ZHER
subroutine zscal(n, za, zx, incx)
ZSCAL
subroutine ztrmv(uplo, trans, diag, n, a, lda, x, incx)
ZTRMV
subroutine zpst01(uplo, n, a, lda, afac, ldafac, perm, ldperm, piv, rwork, resid, rank)
ZPST01