hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_lapack_dpotri (f07fj)

Purpose

nag_lapack_dpotri (f07fj) computes the inverse of a real symmetric positive definite matrix AA, where AA has been factorized by nag_lapack_dpotrf (f07fd).

Syntax

[a, info] = f07fj(uplo, a, 'n', n)
[a, info] = nag_lapack_dpotri(uplo, a, 'n', n)

Description

nag_lapack_dpotri (f07fj) is used to compute the inverse of a real symmetric positive definite matrix AA, the function must be preceded by a call to nag_lapack_dpotrf (f07fd), which computes the Cholesky factorization of AA.
If uplo = 'U'uplo='U', A = UTUA=UTU and A1A-1 is computed by first inverting UU and then forming (U1)UT(U-1)U-T.
If uplo = 'L'uplo='L', A = LLTA=LLT and A1A-1 is computed by first inverting LL and then forming LT(L1)L-T(L-1).

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:     uplo – string (length ≥ 1)
Specifies how AA has been factorized.
uplo = 'U'uplo='U'
A = UTUA=UTU, where UU is upper triangular.
uplo = 'L'uplo='L'
A = LLTA=LLT, where LL is lower triangular.
Constraint: uplo = 'U'uplo='U' or 'L''L'.
2:     a(lda, : :) – double array
The first dimension of the array a must be at least max (1,n)max(1,n)
The second dimension of the array must be at least max (1,n)max(1,n)
The upper triangular matrix UU if uplo = 'U'uplo='U' or the lower triangular matrix LL if uplo = 'L'uplo='L', as returned by nag_lapack_dpotrf (f07fd).

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The first dimension of the array a The second dimension of the array a.
nn, the order of the matrix AA.
Constraint: n0n0.

Input Parameters Omitted from the MATLAB Interface

lda

Output Parameters

1:     a(lda, : :) – double array
The first dimension of the array a will be max (1,n)max(1,n)
The second dimension of the array will be max (1,n)max(1,n)
ldamax (1,n)ldamax(1,n).
UU stores the upper triangle of A1A-1 if uplo = 'U'uplo='U'; LL stores the lower triangle of A1A-1 if uplo = 'L'uplo='L'.
2:     info – int64int32nag_int scalar
info = 0info=0 unless the function detects an error (see Section [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.

  info = iinfo=-i
If info = iinfo=-i, parameter ii had an illegal value on entry. The parameters are numbered as follows:
1: uplo, 2: n, 3: a, 4: lda, 5: info.
It is possible that info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.
W INFO > 0INFO>0
If info = iinfo=i, the iith diagonal element of the Cholesky factor is zero; the Cholesky factor is singular and the inverse of AA cannot be computed.

Accuracy

The computed inverse XX satisfies
XAI2c(n)εκ2(A)   and   AXI2c(n)εκ2(A) ,
XA-I2c(n)εκ2(A)   and   AX-I2c(n)εκ2(A) ,
where c(n)c(n) is a modest function of nn, εε is the machine precision and κ2(A)κ2(A) is the condition number of AA defined by
κ2(A) = A2A12 .
κ2(A)=A2A-12 .

Further Comments

The total number of floating point operations is approximately (2/3)n323n3.
The complex analogue of this function is nag_lapack_zpotri (f07fw).

Example

function nag_lapack_dpotri_example
uplo = 'L';
a = [2.039607805437114, 0, 0, 0;
     -1.529705854077835, 1.640121946685673, 0, 0;
     0.2745625891934577, -0.2499814119483738, 0.7887488055748053, 0;
     -0.04902903378454601, 0.6737303907389101, 0.6616575633742563, 0.5346894269298688];
[aOut, info] = nag_lapack_dpotri(uplo, a)
 

aOut =

    0.6995         0         0         0
    0.7769    1.4239         0         0
    0.7508    1.8255    4.0688         0
   -0.9340   -1.8841   -2.9342    3.4978


info =

                    0


function f07fj_example
uplo = 'L';
a = [2.039607805437114, 0, 0, 0;
     -1.529705854077835, 1.640121946685673, 0, 0;
     0.2745625891934577, -0.2499814119483738, 0.7887488055748053, 0;
     -0.04902903378454601, 0.6737303907389101, 0.6616575633742563, 0.5346894269298688];
[aOut, info] = f07fj(uplo, a)
 

aOut =

    0.6995         0         0         0
    0.7769    1.4239         0         0
    0.7508    1.8255    4.0688         0
   -0.9340   -1.8841   -2.9342    3.4978


info =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013