PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_zpptri (f07gw)
Purpose
nag_lapack_zpptri (f07gw) computes the inverse of a complex Hermitian positive definite matrix
, where
has been factorized by
nag_lapack_zpptrf (f07gr), using packed storage.
Syntax
Description
nag_lapack_zpptri (f07gw) is used to compute the inverse of a complex Hermitian positive definite matrix
, the function must be preceded by a call to
nag_lapack_zpptrf (f07gr), which computes the Cholesky factorization of
, using packed storage.
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:
– int64int32nag_int scalar
-
, the order of the matrix .
Constraint:
.
- 3:
– complex array
-
The dimension of the array
ap
must be at least
The Cholesky factor of
stored in packed form, as returned by
nag_lapack_zpptrf (f07gr).
Optional Input Parameters
None.
Output Parameters
- 1:
– complex array
-
The dimension of the array
ap will be
The factorization stores the
by
matrix
.
More precisely,
- if , the upper triangle of must be stored with element in for ;
- if , the lower triangle of must be stored with element in for .
- 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_dpptri (f07gj).
Example
This example computes the inverse of the matrix
, where
Here
is Hermitian positive definite, stored in packed form, and must first be factorized by
nag_lapack_zpptrf (f07gr).
Open in the MATLAB editor:
f07gw_example
function f07gw_example
fprintf('f07gw example results\n\n');
uplo = 'L';
n = int64(4);
ap = [3.23 + 0i 1.51 + 1.92i 1.90 - 0.84i 0.42 - 2.50i ...
3.58 + 0i -0.23 - 1.11i -1.18 - 1.37i ...
4.09 + 0.00i 2.33 + 0.14i ...
4.29 + 0.00i];
[L, info] = f07gr( ...
uplo, n, ap);
[ainv, info] = f07gw( ...
uplo, n, L);
[ifail] = x04dc( ...
uplo, 'Non-unit', n, ainv, 'Inverse');
f07gw 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