NAG FL Interface
f07awf (zgetri)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

f07awf computes the inverse of a complex matrix A, where A has been factorized by f07arf.

2 Specification

Fortran Interface
Subroutine f07awf ( n, a, lda, ipiv, work, lwork, info)
Integer, Intent (In) :: n, lda, ipiv(*), lwork
Integer, Intent (Out) :: info
Complex (Kind=nag_wp), Intent (Inout) :: a(lda,*)
Complex (Kind=nag_wp), Intent (Out) :: work(max(1,lwork))
C Header Interface
#include <nag.h>
void  f07awf_ (const Integer *n, Complex a[], const Integer *lda, const Integer ipiv[], Complex work[], const Integer *lwork, Integer *info)
The routine may be called by the names f07awf, nagf_lapacklin_zgetri or its LAPACK name zgetri.

3 Description

f07awf is used to compute the inverse of a complex matrix A, the routine must be preceded by a call to f07arf, which computes the LU factorization of A as A=PLU. The inverse of A is computed by forming U-1 and then solving the equation XPL=U-1 for X.

4 References

Du Croz J J and Higham N J (1992) Stability of methods for matrix inversion IMA J. Numer. Anal. 12 1–19

5 Arguments

1: n Integer Input
On entry: n, the order of the matrix A.
Constraint: n0.
2: a(lda,*) Complex (Kind=nag_wp) array Input/Output
Note: the second dimension of the array a must be at least max(1,n).
On entry: the LU factorization of A, as returned by f07arf.
On exit: the factorization is overwritten by the n×n matrix A-1.
3: lda Integer Input
On entry: the first dimension of the array a as declared in the (sub)program from which f07awf is called.
Constraint: ldamax(1,n).
4: ipiv(*) Integer array Input
Note: the dimension of the array ipiv must be at least max(1,n).
On entry: the pivot indices, as returned by f07arf.
5: work(max(1,lwork)) Complex (Kind=nag_wp) array Workspace
On exit: if info=0, work(1) contains the minimum value of lwork required for optimum performance.
6: lwork Integer Input
On entry: the dimension of the array work as declared in the (sub)program from which f07awf is called, unless lwork=−1, in which case a workspace query is assumed and the routine only calculates the optimal dimension of work (using the formula given below).
Suggested value: for optimum performance lwork should be at least n×nb, where nb is the block size.
Constraint: lworkmax(1,n) or lwork=−1.
7: info Integer Output
On exit: info=0 unless the routine detects an error (see Section 6).

6 Error Indicators and Warnings

info<0
If info=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.
info>0
Element value of the diagonal is zero. U is singular, and the inverse of A cannot be computed.

7 Accuracy

The computed inverse X satisfies a bound of the form:
|XA-I|c(n)ε|X|P|L||U| ,  
where c(n) is a modest linear function of n, and ε is the machine precision.
Note that a similar bound for |AX-I| cannot be guaranteed, although it is almost always satisfied. See Du Croz and Higham (1992).

8 Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
f07awf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9 Further Comments

The total number of real floating-point operations is approximately 163n3.
The real analogue of this routine is f07ajf.

10 Example

This example computes the inverse of the matrix A, where
A= ( -1.34+2.55i 0.28+3.17i -6.39-2.20i 0.72-0.92i -0.17-1.41i 3.31-0.15i -0.15+1.34i 1.29+1.38i -3.29-2.39i -1.91+4.42i -0.14-1.35i 1.72+1.35i 2.41+0.39i -0.56+1.47i -0.83-0.69i -1.96+0.67i ) .  
Here A is nonsymmetric and must first be factorized by f07arf.

10.1 Program Text

Program Text (f07awfe.f90)

10.2 Program Data

Program Data (f07awfe.d)

10.3 Program Results

Program Results (f07awfe.r)