PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_zpotri (f07fw)
Purpose
nag_lapack_zpotri (f07fw) computes the inverse of a complex Hermitian positive definite matrix
, where
has been factorized by
nag_lapack_zpotrf (f07fr).
Syntax
Description
nag_lapack_zpotri (f07fw) is used to compute the inverse of a complex Hermitian positive definite matrix
, the function must be preceded by a call to
nag_lapack_zpotrf (f07fr), which computes the Cholesky factorization of
.
If , and is computed by first inverting and then forming .
If , and is computed by first inverting and then forming .
References
Du Croz J J and Higham N J (1992) Stability of methods for matrix inversion IMA J. Numer. Anal. 12 1–19
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
Specifies how
has been factorized.
- , where is upper triangular.
- , where is lower triangular.
Constraint:
or .
- 2:
– complex array
-
The first dimension of the array
a must be at least
.
The second dimension of the array
a must be at least
.
The upper triangular matrix
if
or the lower triangular matrix
if
, as returned by
nag_lapack_zpotrf (f07fr).
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
a and the second dimension of the array
a.
, the order of the matrix .
Constraint:
.
Output Parameters
- 1:
– complex array
-
The first dimension of the array
a will be
.
The second dimension of the array
a will be
.
stores the upper triangle of if ; stores the lower triangle of if .
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Cases prefixed with W are classified as warnings and
do not generate an error of type NAG:error_n. See nag_issue_warnings.
-
If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
- W
-
Diagonal element of the Cholesky factor is zero;
the Cholesky factor is singular and the inverse of cannot
be computed.
Accuracy
The computed inverse
satisfies
where
is a modest function of
,
is the
machine precision and
is the condition number of
defined by
Further Comments
The total number of real floating-point operations is approximately .
The real analogue of this function is
nag_lapack_dpotri (f07fj).
Example
This example computes the inverse of the matrix
, where
Here
is Hermitian positive definite and must first be factorized by
nag_lapack_zpotrf (f07fr).
Open in the MATLAB editor:
f07fw_example
function f07fw_example
fprintf('f07fw example results\n\n');
uplo = 'Lower';
a = [ 3.23 + 0i, 0 + 0i, 0 + 0i, 0 + 0i;
1.51 + 1.92i, 3.58 + 0i, 0 + 0i, 0 + 0i;
1.90 - 0.84i, -0.23 - 1.11i, 4.09 + 0i, 0 + 0i;
0.42 - 2.50i, -1.18 - 1.37i, 2.33 + 0.14i, 4.29 + 0i];
[L, info] = f07fr( ...
uplo, a);
[ainv, info] = f07fw( ...
uplo, L);
[ifail] = x04da( ...
uplo, 'Non-unit', ainv, 'Inverse');
f07fw example results
Inverse
1 2 3 4
1 5.4691
0.0000
2 -1.2624 1.1024
-1.5491 0.0000
3 -2.9746 0.8989 2.1589
-0.9616 -0.5672 0.0000
4 1.1962 -0.9826 -1.3756 2.2934
2.9772 -0.2566 -1.4550 0.0000
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015