111 SUBROUTINE cgetri( N, A, LDA, IPIV, WORK, LWORK, INFO )
118 INTEGER INFO, LDA, LWORK, N
122 COMPLEX A( LDA, * ), WORK( * )
129 parameter( zero = ( 0.0e+0, 0.0e+0 ),
130 $ one = ( 1.0e+0, 0.0e+0 ) )
134 INTEGER I, IWS, J, JB, JJ, JP, LDWORK, LWKOPT, NB,
140 EXTERNAL ilaenv, sroundup_lwork
154 nb = ilaenv( 1,
'CGETRI',
' ', n, -1, -1, -1 )
155 lwkopt = max( 1, n*nb )
156 work( 1 ) = sroundup_lwork( lwkopt )
157 lquery = ( lwork.EQ.-1 )
160 ELSE IF( lda.LT.max( 1, n ) )
THEN
162 ELSE IF( lwork.LT.max( 1, n ) .AND. .NOT.lquery )
THEN
166 CALL xerbla(
'CGETRI', -info )
168 ELSE IF( lquery )
THEN
180 CALL ctrtri(
'Upper',
'Non-unit', n, a, lda, info )
186 IF( nb.GT.1 .AND. nb.LT.n )
THEN
187 iws = max( ldwork*nb, 1 )
188 IF( lwork.LT.iws )
THEN
190 nbmin = max( 2, ilaenv( 2,
'CGETRI',
' ', n, -1, -1,
199 IF( nb.LT.nbmin .OR. nb.GE.n )
THEN
208 work( i ) = a( i, j )
215 $
CALL cgemv(
'No transpose', n, n-j, -one, a( 1, j+1 ),
216 $ lda, work( j+1 ), 1, one, a( 1, j ), 1 )
222 nn = ( ( n-1 ) / nb )*nb + 1
224 jb = min( nb, n-j+1 )
229 DO 40 jj = j, j + jb - 1
231 work( i+( jj-j )*ldwork ) = a( i, jj )
239 $
CALL cgemm(
'No transpose',
'No transpose', n, jb,
240 $ n-j-jb+1, -one, a( 1, j+jb ), lda,
241 $ work( j+jb ), ldwork, one, a( 1, j ), lda )
242 CALL ctrsm(
'Right',
'Lower',
'No transpose',
'Unit', n,
244 $ one, work( j ), ldwork, a( 1, j ), lda )
250 DO 60 j = n - 1, 1, -1
253 $
CALL cswap( n, a( 1, j ), 1, a( 1, jp ), 1 )
256 work( 1 ) = sroundup_lwork( iws )
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine cgetri(n, a, lda, ipiv, work, lwork, info)
CGETRI
subroutine ctrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
CTRSM