178 SUBROUTINE chetrf( UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO )
187 INTEGER info, lda, lwork, n
191 COMPLEX a( lda, * ), work( * )
197 LOGICAL lquery, upper
198 INTEGER iinfo, iws, j, k, kb, ldwork, lwkopt, nb, nbmin
216 upper =
lsame( uplo,
'U' )
217 lquery = ( lwork.EQ.-1 )
218 IF( .NOT.upper .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
220 ELSE IF( n.LT.0 )
THEN
222 ELSE IF( lda.LT.max( 1, n ) )
THEN
224 ELSE IF( lwork.LT.1 .AND. .NOT.lquery )
THEN
232 nb =
ilaenv( 1,
'CHETRF', uplo, n, -1, -1, -1 )
238 CALL
xerbla(
'CHETRF', -info )
240 ELSE IF( lquery )
THEN
246 IF( nb.GT.1 .AND. nb.LT.n )
THEN
248 IF( lwork.LT.iws )
THEN
249 nb = max( lwork / ldwork, 1 )
250 nbmin = max( 2,
ilaenv( 2,
'CHETRF', uplo, n, -1, -1, -1 ) )
279 CALL
clahef( uplo, k, nb, kb, a, lda, ipiv, work, n, iinfo )
284 CALL
chetf2( uplo, k, a, lda, ipiv, iinfo )
290 IF( info.EQ.0 .AND. iinfo.GT.0 )
319 CALL
clahef( uplo, n-k+1, nb, kb, a( k, k ), lda, ipiv( k ),
325 CALL
chetf2( uplo, n-k+1, a( k, k ), lda, ipiv( k ), iinfo )
331 IF( info.EQ.0 .AND. iinfo.GT.0 )
332 $ info = iinfo + k - 1
336 DO 30 j = k, k + kb - 1
337 IF( ipiv( j ).GT.0 )
THEN
338 ipiv( j ) = ipiv( j ) + k - 1
340 ipiv( j ) = ipiv( j ) - k + 1