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_dpptri (f07gj)

Purpose

nag_lapack_dpptri (f07gj) computes the inverse of a real symmetric positive definite matrix AA, where AA has been factorized by nag_lapack_dpptrf (f07gd), using packed storage.

Syntax

[ap, info] = f07gj(uplo, n, ap)
[ap, info] = nag_lapack_dpptri(uplo, n, ap)

Description

nag_lapack_dpptri (f07gj) 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_dpptrf (f07gd), which computes the Cholesky factorization of AA, using packed storage.
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:     n – int64int32nag_int scalar
nn, the order of the matrix AA.
Constraint: n0n0.
3:     ap( : :) – double array
Note: the dimension of the array ap must be at least max (1,n × (n + 1) / 2)max(1,n×(n+1)/2).
The Cholesky factor of AA stored in packed form, as returned by nag_lapack_dpptrf (f07gd).

Optional Input Parameters

None.

Input Parameters Omitted from the MATLAB Interface

None.

Output Parameters

1:     ap( : :) – double array
Note: the dimension of the array ap must be at least max (1,n × (n + 1) / 2)max(1,n×(n+1)/2).
The factorization stores the nn by nn matrix A1A-1.
More precisely,
  • if uplo = 'U'uplo='U', the upper triangle of A1A-1 must be stored with element AijAij in ap(i + j(j1) / 2)api+j(j-1)/2 for ijij;
  • if uplo = 'L'uplo='L', the lower triangle of A1A-1 must be stored with element AijAij in ap(i + (2nj)(j1) / 2)api+(2n-j)(j-1)/2 for ijij.
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: ap, 4: info.
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_zpptri (f07gw).

Example

function nag_lapack_dpptri_example
uplo = 'L';
n = int64(4);
ap = [2.039607805437114;
     -1.529705854077835;
     0.2745625891934577;
     -0.04902903378454601;
     1.640121946685673;
     -0.2499814119483738;
     0.6737303907389101;
     0.7887488055748053;
     0.6616575633742563;
     0.5346894269298685];
[apOut, info] = nag_lapack_dpptri(uplo, n, ap)
 

apOut =

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


info =

                    0


function f07gj_example
uplo = 'L';
n = int64(4);
ap = [2.039607805437114;
     -1.529705854077835;
     0.2745625891934577;
     -0.04902903378454601;
     1.640121946685673;
     -0.2499814119483738;
     0.6737303907389101;
     0.7887488055748053;
     0.6616575633742563;
     0.5346894269298685];
[apOut, info] = f07gj(uplo, n, ap)
 

apOut =

    0.6995
    0.7769
    0.7508
   -0.9340
    1.4239
    1.8255
   -1.8841
    4.0688
   -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