NAG Library Routine Document
F07AJF (DGETRI) computes the inverse of a real matrix
has been factorized by F07ADF (DGETRF)
||N, LDA, IPIV(*), LWORK, INFO
The routine may be called by its
F07AJF (DGETRI) is used to compute the inverse of a real matrix
, the routine must be preceded by a call to F07ADF (DGETRF)
, which computes the
. The inverse of
is computed by forming
and then solving the equation
Du Croz J J and Higham N J (1992) Stability of methods for matrix inversion IMA J. Numer. Anal. 12 1–19
- 1: N – INTEGERInput
On entry: , the order of the matrix .
- 2: A(LDA,) – REAL (KIND=nag_wp) arrayInput/Output
the second dimension of the array A
must be at least
, as returned by F07ADF (DGETRF)
On exit: the factorization is overwritten by the by matrix .
- 3: LDA – INTEGERInput
: the first dimension of the array A
as declared in the (sub)program from which F07AJF (DGETRI) is called.
- 4: IPIV() – INTEGER arrayInput
the dimension of the array IPIV
must be at least
: the pivot indices, as returned by F07ADF (DGETRF)
- 5: WORK() – REAL (KIND=nag_wp) arrayWorkspace
contains the minimum value of LWORK
required for optimum performance.
- 6: LWORK – INTEGERInput
: the dimension of the array WORK
as declared in the (sub)program from which F07AJF (DGETRI) is called, unless
, in which case a workspace query is assumed and the routine only calculates the optimal dimension of WORK
(using the formula given below).
for optimum performance LWORK
should be at least
is the block size
- 7: INFO – INTEGEROutput
unless the routine detects an error (see Section 6
6 Error Indicators and Warnings
Errors or warnings detected by the routine:
If , the th parameter had an illegal value. An explanatory message is output, and execution of the program is terminated.
If , the th diagonal element of the factor is zero, is singular, and the inverse of cannot be computed.
The computed inverse
satisfies a bound of the form:
is a modest linear function of
is the machine precision
Note that a similar bound for
cannot be guaranteed, although it is almost always satisfied. See Du Croz and Higham (1992)
The total number of floating point operations is approximately .
The complex analogue of this routine is F07AWF (ZGETRI)
This example computes the inverse of the matrix
is nonsymmetric and must first be factorized by F07ADF (DGETRF)
9.1 Program Text
Program Text (f07ajfe.f90)
9.2 Program Data
Program Data (f07ajfe.d)
9.3 Program Results
Program Results (f07ajfe.r)