113 SUBROUTINE cgetri( N, A, LDA, IPIV, WORK, LWORK, INFO )
120 INTEGER INFO, LDA, LWORK, N
124 COMPLEX A( LDA, * ), WORK( * )
131 parameter( zero = ( 0.0e+0, 0.0e+0 ),
132 $ one = ( 1.0e+0, 0.0e+0 ) )
136 INTEGER I, IWS, J, JB, JJ, JP, LDWORK, LWKOPT, NB,
142 EXTERNAL ilaenv, sroundup_lwork
155 nb = ilaenv( 1,
'CGETRI',
' ', n, -1, -1, -1 )
157 work( 1 ) = sroundup_lwork(lwkopt)
158 lquery = ( lwork.EQ.-1 )
161 ELSE IF( lda.LT.max( 1, n ) )
THEN
163 ELSE IF( lwork.LT.max( 1, n ) .AND. .NOT.lquery )
THEN
167 CALL xerbla(
'CGETRI', -info )
169 ELSE IF( lquery )
THEN
181 CALL ctrtri(
'Upper',
'Non-unit', n, a, lda, info )
187 IF( nb.GT.1 .AND. nb.LT.n )
THEN
188 iws = max( ldwork*nb, 1 )
189 IF( lwork.LT.iws )
THEN
191 nbmin = max( 2, ilaenv( 2,
'CGETRI',
' ', n, -1, -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, jb,
243 $ one, work( j ), ldwork, a( 1, j ), lda )
249 DO 60 j = n - 1, 1, -1
252 $
CALL cswap( n, a( 1, j ), 1, a( 1, jp ), 1 )
255 work( 1 ) = sroundup_lwork(iws)
subroutine xerbla(srname, info)
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 cswap(n, cx, incx, cy, incy)
CSWAP
subroutine ctrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
CTRSM
subroutine ctrtri(uplo, diag, n, a, lda, info)
CTRTRI