141 SUBROUTINE zpstf2( UPLO, N, A, LDA, PIV, RANK, TOL, WORK, INFO )
149 INTEGER INFO, LDA, N, RANK
153 COMPLEX*16 A( LDA, * )
154 DOUBLE PRECISION WORK( 2*N )
161 DOUBLE PRECISION ONE, ZERO
162 parameter( one = 1.0d+0, zero = 0.0d+0 )
164 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
168 DOUBLE PRECISION AJJ, DSTOP, DTEMP
169 INTEGER I, ITEMP, J, PVT
173 DOUBLE PRECISION DLAMCH
174 LOGICAL LSAME, DISNAN
175 EXTERNAL dlamch, lsame, disnan
181 INTRINSIC dble, dconjg, max, sqrt
188 upper = lsame( uplo,
'U' )
189 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
191 ELSE IF( n.LT.0 )
THEN
193 ELSE IF( lda.LT.max( 1, n ) )
THEN
197 CALL xerbla(
'ZPSTF2', -info )
215 work( i ) = dble( a( i, i ) )
217 pvt = maxloc( work( 1:n ), 1 )
218 ajj = dble( a( pvt, pvt ) )
219 IF( ajj.LE.zero.OR.disnan( ajj ) )
THEN
227 IF( tol.LT.zero )
THEN
228 dstop = n * dlamch(
'Epsilon' ) * ajj
252 work( i ) = work( i ) +
253 $ dble( dconjg( a( j-1, i ) )*
256 work( n+i ) = dble( a( i, i ) ) - work( i )
261 itemp = maxloc( work( (n+j):(2*n) ), 1 )
264 IF( ajj.LE.dstop.OR.disnan( ajj ) )
THEN
274 a( pvt, pvt ) = a( j, j )
275 CALL zswap( j-1, a( 1, j ), 1, a( 1, pvt ), 1 )
277 $
CALL zswap( n-pvt, a( j, pvt+1 ), lda,
278 $ a( pvt, pvt+1 ), lda )
279 DO 140 i = j + 1, pvt - 1
280 ztemp = dconjg( a( j, i ) )
281 a( j, i ) = dconjg( a( i, pvt ) )
284 a( j, pvt ) = dconjg( a( j, pvt ) )
289 work( j ) = work( pvt )
292 piv( pvt ) = piv( j )
302 CALL zlacgv( j-1, a( 1, j ), 1 )
303 CALL zgemv(
'Trans', j-1, n-j, -cone, a( 1, j+1 ), lda,
304 $ a( 1, j ), 1, cone, a( j, j+1 ), lda )
305 CALL zlacgv( j-1, a( 1, j ), 1 )
306 CALL zdscal( n-j, one / ajj, a( j, j+1 ), lda )
324 work( i ) = work( i ) +
325 $ dble( dconjg( a( i, j-1 ) )*
328 work( n+i ) = dble( a( i, i ) ) - work( i )
333 itemp = maxloc( work( (n+j):(2*n) ), 1 )
336 IF( ajj.LE.dstop.OR.disnan( ajj ) )
THEN
346 a( pvt, pvt ) = a( j, j )
347 CALL zswap( j-1, a( j, 1 ), lda, a( pvt, 1 ), lda )
349 $
CALL zswap( n-pvt, a( pvt+1, j ), 1, a( pvt+1, pvt ),
351 DO 170 i = j + 1, pvt - 1
352 ztemp = dconjg( a( i, j ) )
353 a( i, j ) = dconjg( a( pvt, i ) )
356 a( pvt, j ) = dconjg( a( pvt, j ) )
361 work( j ) = work( pvt )
364 piv( pvt ) = piv( j )
374 CALL zlacgv( j-1, a( j, 1 ), lda )
375 CALL zgemv(
'No Trans', n-j, j-1, -cone, a( j+1, 1 ),
376 $ lda, a( j, 1 ), lda, cone, a( j+1, j ), 1 )
377 CALL zlacgv( j-1, a( j, 1 ), lda )
378 CALL zdscal( n-j, one / ajj, a( j+1, j ), 1 )
subroutine xerbla(srname, info)
subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
ZGEMV
subroutine zlacgv(n, x, incx)
ZLACGV conjugates a complex vector.
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 zswap(n, zx, incx, zy, incy)
ZSWAP