PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dpptri (f07gj)
Purpose
nag_lapack_dpptri (f07gj) computes the inverse of a real symmetric positive definite matrix
, where
has been factorized by
nag_lapack_dpptrf (f07gd), using packed storage.
Syntax
Description
nag_lapack_dpptri (f07gj) is used to compute the inverse of a real symmetric positive definite matrix
, the function must be preceded by a call to
nag_lapack_dpptrf (f07gd), 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:
– double array
-
The dimension of the array
ap
must be at least
The Cholesky factor of
stored in packed form, as returned by
nag_lapack_dpptrf (f07gd).
Optional Input Parameters
None.
Output Parameters
- 1:
– double 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 floating-point operations is approximately .
The complex analogue of this function is
nag_lapack_zpptri (f07gw).
Example
This example computes the inverse of the matrix
, where
Here
is symmetric positive definite, stored in packed form, and must first be factorized by
nag_lapack_dpptrf (f07gd).
Open in the MATLAB editor:
f07gj_example
function f07gj_example
fprintf('f07gj example results\n\n');
uplo = 'L';
n = int64(4);
ap = [4.16 -3.12 0.56 -0.10 ...
5.03 -0.83 1.18 ...
0.76 0.34 ...
1.18];
[L, info] = f07gd( ...
uplo, n, ap);
[ainv, info] = f07gj( ...
uplo, n, L);
[ifail] = x04cc( ...
uplo, 'N', n, ainv, 'Inverse');
f07gj example results
Inverse
1 2 3 4
1 0.6995
2 0.7769 1.4239
3 0.7508 1.8255 4.0688
4 -0.9340 -1.8841 -2.9342 3.4978
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015