143 SUBROUTINE zpstf2( UPLO, N, A, LDA, PIV, RANK, TOL, WORK, INFO )
152 INTEGER INFO, LDA, N, RANK
156 COMPLEX*16 A( lda, * )
157 DOUBLE PRECISION WORK( 2*n )
164 DOUBLE PRECISION ONE, ZERO
165 parameter ( one = 1.0d+0, zero = 0.0d+0 )
167 parameter ( cone = ( 1.0d+0, 0.0d+0 ) )
171 DOUBLE PRECISION AJJ, DSTOP, DTEMP
172 INTEGER I, ITEMP, J, PVT
176 DOUBLE PRECISION DLAMCH
177 LOGICAL LSAME, DISNAN
178 EXTERNAL dlamch, lsame, disnan
184 INTRINSIC dble, dconjg, max, sqrt
191 upper = lsame( uplo,
'U' )
192 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
194 ELSE IF( n.LT.0 )
THEN
196 ELSE IF( lda.LT.max( 1, n ) )
THEN
200 CALL xerbla(
'ZPSTF2', -info )
218 work( i ) = dble( a( i, i ) )
220 pvt = maxloc( work( 1:n ), 1 )
221 ajj = dble( a( pvt, pvt ) )
222 IF( ajj.LE.zero.OR.disnan( ajj ) )
THEN
230 IF( tol.LT.zero )
THEN
231 dstop = n * dlamch(
'Epsilon' ) * ajj
255 work( i ) = work( i ) +
256 $ dble( dconjg( a( j-1, i ) )*
259 work( n+i ) = dble( a( i, i ) ) - work( i )
264 itemp = maxloc( work( (n+j):(2*n) ), 1 )
267 IF( ajj.LE.dstop.OR.disnan( ajj ) )
THEN
277 a( pvt, pvt ) = a( j, j )
278 CALL zswap( j-1, a( 1, j ), 1, a( 1, pvt ), 1 )
280 $
CALL zswap( n-pvt, a( j, pvt+1 ), lda,
281 $ a( pvt, pvt+1 ), lda )
282 DO 140 i = j + 1, pvt - 1
283 ztemp = dconjg( a( j, i ) )
284 a( j, i ) = dconjg( a( i, pvt ) )
287 a( j, pvt ) = dconjg( a( j, pvt ) )
292 work( j ) = work( pvt )
295 piv( pvt ) = piv( j )
305 CALL zlacgv( j-1, a( 1, j ), 1 )
306 CALL zgemv(
'Trans', j-1, n-j, -cone, a( 1, j+1 ), lda,
307 $ a( 1, j ), 1, cone, a( j, j+1 ), lda )
308 CALL zlacgv( j-1, a( 1, j ), 1 )
309 CALL zdscal( n-j, one / ajj, a( j, j+1 ), lda )
327 work( i ) = work( i ) +
328 $ dble( dconjg( a( i, j-1 ) )*
331 work( n+i ) = dble( a( i, i ) ) - work( i )
336 itemp = maxloc( work( (n+j):(2*n) ), 1 )
339 IF( ajj.LE.dstop.OR.disnan( ajj ) )
THEN
349 a( pvt, pvt ) = a( j, j )
350 CALL zswap( j-1, a( j, 1 ), lda, a( pvt, 1 ), lda )
352 $
CALL zswap( n-pvt, a( pvt+1, j ), 1, a( pvt+1, pvt ),
354 DO 170 i = j + 1, pvt - 1
355 ztemp = dconjg( a( i, j ) )
356 a( i, j ) = dconjg( a( pvt, i ) )
359 a( pvt, j ) = dconjg( a( pvt, j ) )
364 work( j ) = work( pvt )
367 piv( pvt ) = piv( j )
377 CALL zlacgv( j-1, a( j, 1 ), lda )
378 CALL zgemv(
'No Trans', n-j, j-1, -cone, a( j+1, 1 ),
379 $ lda, a( j, 1 ), lda, cone, a( j+1, j ), 1 )
380 CALL zlacgv( j-1, a( j, 1 ), lda )
381 CALL zdscal( n-j, one / ajj, a( j+1, j ), 1 )
subroutine zgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
ZGEMV
subroutine zswap(N, ZX, INCX, ZY, INCY)
ZSWAP
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine zpstf2(UPLO, N, A, LDA, PIV, RANK, TOL, WORK, INFO)
ZPSTF2 computes the Cholesky factorization with complete pivoting of a complex Hermitian positive sem...
subroutine zdscal(N, DA, ZX, INCX)
ZDSCAL
subroutine zlacgv(N, X, INCX)
ZLACGV conjugates a complex vector.