113 SUBROUTINE sgetri( N, A, LDA, IPIV, WORK, LWORK, INFO )
120 INTEGER INFO, LDA, LWORK, N
124 REAL A( LDA, * ), WORK( * )
131 parameter( zero = 0.0e+0, one = 1.0e+0 )
135 INTEGER I, IWS, J, JB, JJ, JP, LDWORK, LWKOPT, NB,
141 EXTERNAL ilaenv, sroundup_lwork
154 nb = ilaenv( 1,
'SGETRI',
' ', n, -1, -1, -1 )
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(
'SGETRI', -info )
168 ELSE IF( lquery )
THEN
180 CALL strtri(
'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,
'SGETRI',
' ', n, -1, -1, -1 ) )
198 IF( nb.LT.nbmin .OR. nb.GE.n )
THEN
207 work( i ) = a( i, j )
214 $
CALL sgemv(
'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 sgemm(
'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 strsm(
'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 sswap( n, a( 1, j ), 1, a( 1, jp ), 1 )
254 work( 1 ) = sroundup_lwork(iws)
subroutine xerbla(srname, info)
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
subroutine sgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
SGEMV
subroutine sgetri(n, a, lda, ipiv, work, lwork, info)
SGETRI
subroutine sswap(n, sx, incx, sy, incy)
SSWAP
subroutine strsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
STRSM
subroutine strtri(uplo, diag, n, a, lda, info)
STRTRI