141 SUBROUTINE cpstf2( UPLO, N, A, LDA, PIV, RANK, TOL, WORK, INFO )
149 INTEGER INFO, LDA, N, RANK
162 parameter( one = 1.0e+0, zero = 0.0e+0 )
164 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
168 REAL AJJ, SSTOP, STEMP
169 INTEGER I, ITEMP, J, PVT
174 LOGICAL LSAME, SISNAN
175 EXTERNAL slamch, lsame, sisnan
181 INTRINSIC conjg, max, real, 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(
'CPSTF2', -info )
215 work( i ) = real( a( i, i ) )
217 pvt = maxloc( work( 1:n ), 1 )
218 ajj = real( a( pvt, pvt ) )
219 IF( ajj.LE.zero.OR.sisnan( ajj ) )
THEN
227 IF( tol.LT.zero )
THEN
228 sstop = n * slamch(
'Epsilon' ) * ajj
252 work( i ) = work( i ) +
253 $ real( conjg( a( j-1, i ) )*
256 work( n+i ) = real( a( i, i ) ) - work( i )
261 itemp = maxloc( work( (n+j):(2*n) ), 1 )
264 IF( ajj.LE.sstop.OR.sisnan( ajj ) )
THEN
274 a( pvt, pvt ) = a( j, j )
275 CALL cswap( j-1, a( 1, j ), 1, a( 1, pvt ), 1 )
277 $
CALL cswap( n-pvt, a( j, pvt+1 ), lda,
278 $ a( pvt, pvt+1 ), lda )
279 DO 140 i = j + 1, pvt - 1
280 ctemp = conjg( a( j, i ) )
281 a( j, i ) = conjg( a( i, pvt ) )
284 a( j, pvt ) = conjg( a( j, pvt ) )
289 work( j ) = work( pvt )
292 piv( pvt ) = piv( j )
302 CALL clacgv( j-1, a( 1, j ), 1 )
303 CALL cgemv(
'Trans', j-1, n-j, -cone, a( 1, j+1 ), lda,
304 $ a( 1, j ), 1, cone, a( j, j+1 ), lda )
305 CALL clacgv( j-1, a( 1, j ), 1 )
306 CALL csscal( n-j, one / ajj, a( j, j+1 ), lda )
324 work( i ) = work( i ) +
325 $ real( conjg( a( i, j-1 ) )*
328 work( n+i ) = real( a( i, i ) ) - work( i )
333 itemp = maxloc( work( (n+j):(2*n) ), 1 )
336 IF( ajj.LE.sstop.OR.sisnan( ajj ) )
THEN
346 a( pvt, pvt ) = a( j, j )
347 CALL cswap( j-1, a( j, 1 ), lda, a( pvt, 1 ), lda )
349 $
CALL cswap( n-pvt, a( pvt+1, j ), 1, a( pvt+1, pvt ),
351 DO 170 i = j + 1, pvt - 1
352 ctemp = conjg( a( i, j ) )
353 a( i, j ) = conjg( a( pvt, i ) )
356 a( pvt, j ) = conjg( a( pvt, j ) )
361 work( j ) = work( pvt )
364 piv( pvt ) = piv( j )
374 CALL clacgv( j-1, a( j, 1 ), lda )
375 CALL cgemv(
'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 clacgv( j-1, a( j, 1 ), lda )
378 CALL csscal( n-j, one / ajj, a( j+1, j ), 1 )
subroutine xerbla(srname, info)
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine clacgv(n, x, incx)
CLACGV conjugates a complex vector.
subroutine cpstf2(uplo, n, a, lda, piv, rank, tol, work, info)
CPSTF2 computes the Cholesky factorization with complete pivoting of complex Hermitian positive semid...
subroutine csscal(n, sa, cx, incx)
CSSCAL
subroutine cswap(n, cx, incx, cy, incy)
CSWAP