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_matop_real_symm_posdef_inv_noref (f01ad)

Purpose

nag_matop_real_symm_posdef_inv_noref (f01ad) calculates the approximate inverse of a real symmetric positive definite matrix, using a Cholesky factorization.

Syntax

[a, ifail] = f01ad(a, 'n', n)
[a, ifail] = nag_matop_real_symm_posdef_inv_noref(a, 'n', n)

Description

To compute the inverse XX of a real symmetric positive definite matrix AA, nag_matop_real_symm_posdef_inv_noref (f01ad) first computes a Cholesky factorization of AA as A = LLTA=LLT, where LL is lower triangular. It then computes L1L-1 and finally forms XX as the product LTL1L-TL-1.

References

Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag

Parameters

Compulsory Input Parameters

1:     a(lda, : :) – double array
The first dimension of the array a must be at least n + 1n+1
The second dimension of the array must be at least max (1,n)max(1,n)
The upper triangle of the nn by nn positive definite symmetric matrix AA. The elements of the array below the diagonal need not be set.

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: 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 n + 1n+1
The second dimension of the array will be max (1,n)max(1,n)
ldan + 1ldan+1.
The lower triangle of the inverse matrix XX is stored in the elements of the array below the diagonal, in rows 22 to n + 1n+1; xijxij is stored in a(i + 1,j)ai+1j for ijij. The upper triangle of the original matrix is unchanged.
2:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Errors or warnings detected by the function:
  ifail = 1ifail=1
The matrix AA is not positive definite, possibly due to rounding errors.
  ifail = 2ifail=2
On entry,n < 0n<0,
orlda < n + 1lda<n+1.

Accuracy

The accuracy of the computed inverse depends on the conditioning of the original matrix. For a detailed error analysis see page 39 of Wilkinson and Reinsch (1971).

Further Comments

The time taken by nag_matop_real_symm_posdef_inv_noref (f01ad) is approximately proportional to n3n3. nag_matop_real_symm_posdef_inv_noref (f01ad) calls functions nag_lapack_dpotrf (f07fd) and nag_lapack_dpotri (f07fj) from LAPACK.

Example

function nag_matop_real_symm_posdef_inv_noref_example
a = [5, 7, 6, 5;
     7, 10, 8, 7;
     6, 8, 10, 9;
     5, 7, 9, 10;
     0, 0, 0, 0];
[aOut, ifail] = nag_matop_real_symm_posdef_inv_noref(a)
 

aOut =

    5.0000    7.0000    6.0000    5.0000
   68.0000   10.0000    8.0000    7.0000
  -41.0000   25.0000   10.0000    9.0000
  -17.0000   10.0000    5.0000   10.0000
   10.0000   -6.0000   -3.0000    2.0000


ifail =

                    0


function f01ad_example
a = [5, 7, 6, 5;
     7, 10, 8, 7;
     6, 8, 10, 9;
     5, 7, 9, 10;
     0, 0, 0, 0];
[aOut, ifail] = f01ad(a)
 

aOut =

    5.0000    7.0000    6.0000    5.0000
   68.0000   10.0000    8.0000    7.0000
  -41.0000   25.0000   10.0000    9.0000
  -17.0000   10.0000    5.0000   10.0000
   10.0000   -6.0000   -3.0000    2.0000


ifail =

                    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