PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dpotri (f07fj)
Purpose
nag_lapack_dpotri (f07fj) computes the inverse of a real symmetric positive definite matrix
, where
has been factorized by
nag_lapack_dpotrf (f07fd).
Syntax
Description
nag_lapack_dpotri (f07fj) is used to compute the inverse of a real symmetric positive definite matrix
, the function must be preceded by a call to
nag_lapack_dpotrf (f07fd), 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:
– double 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_dpotrf (f07fd).
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:
– double 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 floating-point operations is approximately .
The complex analogue of this function is
nag_lapack_zpotri (f07fw).
Example
This example computes the inverse of the matrix
, where
Here
is symmetric positive definite and must first be factorized by
nag_lapack_dpotrf (f07fd).
Open in the MATLAB editor:
f07fj_example
function f07fj_example
fprintf('f07fj example results\n\n');
uplo = 'Lower';
a = [ 4.16, 0, 0, 0;
-3.12, 5.03, 0, 0;
0.56, -0.83, 0.76, 0;
-0.10, 1.18, 0.34, 1.18];
[L, info] = f07fd( ...
uplo, a);
[ainv, info] = f07fj( ...
uplo, L);
[ifail] = x04ca( ...
uplo, 'N', ainv, 'Inverse');
f07fj 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