141 SUBROUTINE dpstrf( UPLO, N, A, LDA, PIV, RANK, TOL, WORK, INFO )
149 INTEGER INFO, LDA, N, RANK
153 DOUBLE PRECISION A( LDA, * ), WORK( 2*N )
160 DOUBLE PRECISION ONE, ZERO
161 parameter( one = 1.0d+0, zero = 0.0d+0 )
164 DOUBLE PRECISION AJJ, DSTOP, DTEMP
165 INTEGER I, ITEMP, J, JB, K, NB, PVT
169 DOUBLE PRECISION DLAMCH
171 LOGICAL LSAME, DISNAN
172 EXTERNAL dlamch, ilaenv, lsame, disnan
178 INTRINSIC max, min, sqrt, maxloc
185 upper = lsame( uplo,
'U' )
186 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
188 ELSE IF( n.LT.0 )
THEN
190 ELSE IF( lda.LT.max( 1, n ) )
THEN
194 CALL xerbla(
'DPSTRF', -info )
205 nb = ilaenv( 1,
'DPOTRF', uplo, n, -1, -1, -1 )
206 IF( nb.LE.1 .OR. nb.GE.n )
THEN
210 CALL dpstf2( uplo, n, a( 1, 1 ), lda, piv, rank, tol, work,
227 IF( a( i, i ).GT.ajj )
THEN
232 IF( ajj.LE.zero.OR.disnan( ajj ) )
THEN
240 IF( tol.LT.zero )
THEN
241 dstop = n * dlamch(
'Epsilon' ) * ajj
255 jb = min( nb, n-k+1 )
264 DO 130 j = k, k + jb - 1
273 work( i ) = work( i ) + a( j-1, i )**2
275 work( n+i ) = a( i, i ) - work( i )
280 itemp = maxloc( work( (n+j):(2*n) ), 1 )
283 IF( ajj.LE.dstop.OR.disnan( ajj ) )
THEN
293 a( pvt, pvt ) = a( j, j )
294 CALL dswap( j-1, a( 1, j ), 1, a( 1, pvt ), 1 )
296 $
CALL dswap( n-pvt, a( j, pvt+1 ), lda,
297 $ a( pvt, pvt+1 ), lda )
298 CALL dswap( pvt-j-1, a( j, j+1 ), lda,
304 work( j ) = work( pvt )
307 piv( pvt ) = piv( j )
317 CALL dgemv(
'Trans', j-k, n-j, -one, a( k, j+1 ),
318 $ lda, a( k, j ), 1, one, a( j, j+1 ),
320 CALL dscal( n-j, one / ajj, a( j, j+1 ), lda )
328 CALL dsyrk(
'Upper',
'Trans', n-j+1, jb, -one,
329 $ a( k, j ), lda, one, a( j, j ), lda )
342 jb = min( nb, n-k+1 )
351 DO 170 j = k, k + jb - 1
360 work( i ) = work( i ) + a( i, j-1 )**2
362 work( n+i ) = a( i, i ) - work( i )
367 itemp = maxloc( work( (n+j):(2*n) ), 1 )
370 IF( ajj.LE.dstop.OR.disnan( ajj ) )
THEN
380 a( pvt, pvt ) = a( j, j )
381 CALL dswap( j-1, a( j, 1 ), lda, a( pvt, 1 ), lda )
383 $
CALL dswap( n-pvt, a( pvt+1, j ), 1,
384 $ a( pvt+1, pvt ), 1 )
385 CALL dswap( pvt-j-1, a( j+1, j ), 1, a( pvt, j+1 ),
391 work( j ) = work( pvt )
394 piv( pvt ) = piv( j )
404 CALL dgemv(
'No Trans', n-j, j-k, -one,
405 $ a( j+1, k ), lda, a( j, k ), lda, one,
407 CALL dscal( n-j, one / ajj, a( j+1, j ), 1 )
415 CALL dsyrk(
'Lower',
'No Trans', n-j+1, jb, -one,
416 $ a( j, k ), lda, one, a( j, j ), lda )
subroutine xerbla(srname, info)
subroutine dgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
DGEMV
subroutine dsyrk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
DSYRK
subroutine dpstf2(uplo, n, a, lda, piv, rank, tol, work, info)
DPSTF2 computes the Cholesky factorization with complete pivoting of a real symmetric positive semide...
subroutine dpstrf(uplo, n, a, lda, piv, rank, tol, work, info)
DPSTRF computes the Cholesky factorization with complete pivoting of a real symmetric positive semide...
subroutine dscal(n, da, dx, incx)
DSCAL
subroutine dswap(n, dx, incx, dy, incy)
DSWAP