Developer Reference

  • 2020.2
  • 07/15/2020
  • Public Content
Contents

?getri

Computes the inverse of an LU-factored general matrix.

Syntax

call sgetri
(
n
,
a
,
lda
,
ipiv
,
work
,
lwork
,
info
)
call dgetri
(
n
,
a
,
lda
,
ipiv
,
work
,
lwork
,
info
)
call cgetri
(
n
,
a
,
lda
,
ipiv
,
work
,
lwork
,
info
)
call zgetri
(
n
,
a
,
lda
,
ipiv
,
work
,
lwork
,
info
)
call getri
(
a
,
ipiv
[
,
info
]
)
Include Files
  • mkl.fi
    ,
    lapack.f90
Description
The routine computes the inverse
inv(
A
)
of a general matrix
A
. Before calling this routine, call
?getrf
to factorize
A
.
Input Parameters
n
INTEGER
.
The order of the matrix
A
;
n
0
.
a
,
work
REAL
for
sgetri
DOUBLE PRECISION
for
dgetri
COMPLEX
for
cgetri
DOUBLE COMPLEX
for
zgetri
.
Arrays:
a
(
lda
,*)
,
work
(*)
.
a
(
lda
,*)
contains the factorization of the matrix
A
, as returned by
?getrf
:
A
=
P*L*U
.
The second dimension of
a
must be at least
max(1,
n
)
.
work
(*)
is a workspace array of dimension at least
max(1,
lwork
)
.
lda
INTEGER
.
The leading dimension of
a
;
lda
max(1,
n
)
.
ipiv
INTEGER
.
Array, size at least
max(1,
n
)
.
The
ipiv
array, as returned by
?getrf
.
lwork
INTEGER
.
The size of the
work
array;
lwork
n
.
If
lwork
= -1
, then a workspace query is assumed; the routine only calculates the optimal size of the
work
array, returns this value as the first entry of the
work
array, and no error message related to
lwork
is issued by
xerbla
.
See
Application Notes
below for the suggested value of
lwork
.
Output Parameters
a
Overwritten by the
n
-by-
n
matrix
inv(
A
)
.
work
(1)
If
info
= 0
, on exit
work
(1)
contains the minimum value of
lwork
required for optimum performance. Use this
lwork
for subsequent runs.
info
INTEGER
.
If
info
= 0
, the execution is successful.