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_band_sym (f03ac)

Purpose

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

Syntax

[det, rl, ifail] = f03ac(a, m, 'n', n, 'm1', m1)
[det, rl, ifail] = nag_det_withdraw_real_band_sym(a, m, 'n', n, 'm1', m1)
Note: the interface to this routine has changed since earlier releases of the toolbox:
Mark 22: n has been made optional
.

Description

The determinant of AA is calculated using the Cholesky factorization A = LLTA=LLT, where LL is a lower triangular band matrix. 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,m1) – double array
lda, the first dimension of the array, must satisfy the constraint ldanldan.
The lower triangle of the nn by nn positive definite symmetric band matrix AA, with the diagonal of the matrix stored in the (m + 1)(m+1)th column of the array, and the mm subdiagonals within the band stored in the first mm columns of the array. Each row of the matrix is stored in the corresponding row of the array. For example, if n = 5n=5 and m = 2m=2, the storage scheme is
  * * a11 * a21 a22 a31 a32 a33 a42 a43 a44 a53 a54 a55  
.
* * a11 * a21 a22 a31 a32 a33 a42 a43 a44 a53 a54 a55 .
The elements in the top left corner of the array are not used. The following code may be used to assign elements within the band of the lower triangle of the matrix to the correct elements of the array:
 for i=1:n for j=max(1,i-m):i a(i,j-i+m+1) = matrix(i,j); end end 
2:     m – int64int32nag_int scalar
mm, the number of subdiagonals within the band of AA.

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The first dimension of the array a.
nn, the order of the matrix AA.
2:     m1 – int64int32nag_int scalar
Default: The second dimension of the array a.
The value m + 1m+1.

Input Parameters Omitted from the MATLAB Interface

lda ldrl

Output Parameters

1:     det – double scalar
The determinant of AA.
2:     rl(ldrl,m1) – double array
ldrlnldrln.
The lower triangular matrix LL, stored in the same way as AA, except that in place of the diagonal elements, their reciprocals are stored.
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.
  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.

Accuracy

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

Further Comments

The time taken by nag_det_withdraw_real_band_sym (f03ac) is approximately proportional to n(m + 1)2n (m+1) 2.
This function should only be used when mnmn since as mm approaches nn, it becomes less efficient to take advantage of the band form.

Example

function nag_det_withdraw_real_band_sym_example
a = [0, 0, 5;
     0, -4, 6;
     1, -4, 6;
     1, -4, 6;
     1, -4, 6;
     1, -4, 6;
     1, -4, 5];
m = int64(2);
[det, rl, ifail] = nag_det_withdraw_real_band_sym(a, m)
 

det =

   64.0000


rl =

         0         0    0.4472
         0   -1.7889    0.5976
    0.4472   -1.9124    0.6831
    0.5976   -1.9518    0.7385
    0.6831   -1.9695    0.7774
    0.7385   -1.9789    0.8062
    0.7774   -1.9846    1.4790


ifail =

                    0


function f03ac_example
a = [0, 0, 5;
     0, -4, 6;
     1, -4, 6;
     1, -4, 6;
     1, -4, 6;
     1, -4, 6;
     1, -4, 5];
m = int64(2);
[det, rl, ifail] = f03ac(a, m)
 

det =

   64.0000


rl =

         0         0    0.4472
         0   -1.7889    0.5976
    0.4472   -1.9124    0.6831
    0.5976   -1.9518    0.7385
    0.6831   -1.9695    0.7774
    0.7385   -1.9789    0.8062
    0.7774   -1.9846    1.4790


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