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_det_withdraw_real_sym (f03ab)

Purpose

nag_det_withdraw_real_sym (f03ab) calculates the determinant of a real symmetric positive definite matrix using a Cholesky factorization.
Note: this function is scheduled to be withdrawn, please see f03ab in Advice on Replacement Calls for Withdrawn/Superseded Routines..

Syntax

[a, det, ifail] = f03ab(a, 'n', n)
[a, det, ifail] = nag_det_withdraw_real_sym(a, 'n', n)

Description

The determinant of AA is calculated using the Cholesky factorization A = LLTA=LLT, where LL is lower triangular. The determinant of AA is the product of the squares of the diagonal elements of LL.

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 max (1,n)max(1,n)
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 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 wkspce

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).
The subdiagonal elements of the lower triangular matrix LL. The upper triangle of AA is unchanged.
2:     det – double scalar
The determinant of AA.
3:     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. The factorization could not be completed. det is set to 0.00.0.
  ifail = 2ifail=2
Overflow. The value of the determinant is too large to be held in the computer.
  ifail = 3ifail=3
Underflow. The value of the determinant is too small to be held in the computer.
  ifail = 4ifail=4
On entry,n < 0n<0,
orlda < max (1,n)lda<max(1,n).

Accuracy

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

Further Comments

The time taken by nag_det_withdraw_real_sym (f03ab) is approximately proportional to n3n3.

Example

function nag_det_withdraw_real_sym_example
a = [5, 7, 6, 5;
     7, 10, 8, 7;
     6, 8, 10, 9;
     5, 7, 9, 10];
[aOut, det, ifail] = nag_det_withdraw_real_sym(a)
 

aOut =

    5.0000    7.0000    6.0000    5.0000
    3.1305   10.0000    8.0000    7.0000
    2.6833   -0.8944   10.0000    9.0000
    2.2361         0    2.1213   10.0000


det =

    1.0000


ifail =

                    0


function f03ab_example
a = [5, 7, 6, 5;
     7, 10, 8, 7;
     6, 8, 10, 9;
     5, 7, 9, 10];
[aOut, det, ifail] = f03ab(a)
 

aOut =

    5.0000    7.0000    6.0000    5.0000
    3.1305   10.0000    8.0000    7.0000
    2.6833   -0.8944   10.0000    9.0000
    2.2361         0    2.1213   10.0000


det =

    1.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