136 SUBROUTINE zpst01( UPLO, N, A, LDA, AFAC, LDAFAC, PERM, LDPERM,
137 $ piv, rwork, resid, rank )
145 DOUBLE PRECISION RESID
146 INTEGER LDA, LDAFAC, LDPERM, N, RANK
150 COMPLEX*16 A( lda, * ), AFAC( ldafac, * ),
152 DOUBLE PRECISION RWORK( * )
159 DOUBLE PRECISION ZERO, ONE
160 parameter ( zero = 0.0d+0, one = 1.0d+0 )
162 parameter ( czero = ( 0.0d+0, 0.0d+0 ) )
166 DOUBLE PRECISION ANORM, EPS, TR
171 DOUBLE PRECISION DLAMCH, ZLANHE
173 EXTERNAL zdotc, dlamch, zlanhe, lsame
179 INTRINSIC dble, dconjg, dimag
192 eps = dlamch(
'Epsilon' )
193 anorm = zlanhe(
'1', uplo, n, a, lda, rwork )
194 IF( anorm.LE.zero )
THEN
203 IF( dimag( afac( j, j ) ).NE.zero )
THEN
211 IF( lsame( uplo,
'U' ) )
THEN
214 DO 120 j = rank + 1, n
215 DO 110 i = rank + 1, j
225 tr = zdotc( k, afac( 1, k ), 1, afac( 1, k ), 1 )
230 CALL ztrmv(
'Upper',
'Conjugate',
'Non-unit', k-1, afac,
231 $ ldafac, afac( 1, k ), 1 )
240 DO 150 j = rank + 1, n
252 $
CALL zher(
'Lower', n-k, one, afac( k+1, k ), 1,
253 $ afac( k+1, k+1 ), ldafac )
258 CALL zscal( n-k+1, tc, afac( k, k ), 1 )
265 IF( lsame( uplo,
'U' ) )
THEN
269 IF( piv( i ).LE.piv( j ) )
THEN
271 perm( piv( i ), piv( j ) ) = afac( i, j )
273 perm( piv( i ), piv( j ) ) = dconjg( afac( j, i ) )
284 IF( piv( i ).GE.piv( j ) )
THEN
286 perm( piv( i ), piv( j ) ) = afac( i, j )
288 perm( piv( i ), piv( j ) ) = dconjg( afac( j, i ) )
298 IF( lsame( uplo,
'U' ) )
THEN
301 perm( i, j ) = perm( i, j ) - a( i, j )
303 perm( j, j ) = perm( j, j ) - dble( a( j, j ) )
307 perm( j, j ) = perm( j, j ) - dble( a( j, j ) )
309 perm( i, j ) = perm( i, j ) - a( i, j )
317 resid = zlanhe(
'1', uplo, n, perm, ldafac, rwork )
319 resid = ( ( resid / dble( n ) ) / anorm ) / eps
subroutine zpst01(UPLO, N, A, LDA, AFAC, LDAFAC, PERM, LDPERM, PIV, RWORK, RESID, RANK)
ZPST01
subroutine zher(UPLO, N, ALPHA, X, INCX, A, LDA)
ZHER
subroutine ztrmv(UPLO, TRANS, DIAG, N, A, LDA, X, INCX)
ZTRMV
subroutine zscal(N, ZA, ZX, INCX)
ZSCAL