113 SUBROUTINE zgetri( N, A, LDA, IPIV, WORK, LWORK, INFO )
120 INTEGER INFO, LDA, LWORK, N
124 COMPLEX*16 A( LDA, * ), WORK( * )
131 parameter( zero = ( 0.0d+0, 0.0d+0 ),
132 $ one = ( 1.0d+0, 0.0d+0 ) )
136 INTEGER I, IWS, J, JB, JJ, JP, LDWORK, LWKOPT, NB,
154 nb = ilaenv( 1,
'ZGETRI',
' ', n, -1, -1, -1 )
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(
'ZGETRI', -info )
168 ELSE IF( lquery )
THEN
180 CALL ztrtri(
'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,
'ZGETRI',
' ', n, -1, -1, -1 ) )
198 IF( nb.LT.nbmin .OR. nb.GE.n )
THEN
207 work( i ) = a( i, j )
214 $
CALL zgemv(
'No transpose', n, n-j, -one, a( 1, j+1 ),
215 $ lda, work( j+1 ), 1, one, a( 1, j ), 1 )
221 nn = ( ( n-1 ) / nb )*nb + 1
223 jb = min( nb, n-j+1 )
228 DO 40 jj = j, j + jb - 1
230 work( i+( jj-j )*ldwork ) = a( i, jj )
238 $
CALL zgemm(
'No transpose',
'No transpose', n, jb,
239 $ n-j-jb+1, -one, a( 1, j+jb ), lda,
240 $ work( j+jb ), ldwork, one, a( 1, j ), lda )
241 CALL ztrsm(
'Right',
'Lower',
'No transpose',
'Unit', n, jb,
242 $ one, work( j ), ldwork, a( 1, j ), lda )
248 DO 60 j = n - 1, 1, -1
251 $
CALL zswap( n, a( 1, j ), 1, a( 1, jp ), 1 )
subroutine xerbla(srname, info)
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
ZGEMV
subroutine zgetri(n, a, lda, ipiv, work, lwork, info)
ZGETRI
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
subroutine ztrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
ZTRSM
subroutine ztrtri(uplo, diag, n, a, lda, info)
ZTRTRI