F03BHF (PDF version)
F03 Chapter Contents
F03 Chapter Introduction
NAG Library Manual

NAG Library Routine Document


Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

F03BHF computes the determinant of a n by n symmetric positive definite banded matrix A that has been stored in band-symmetric storage. F07HDF (DPBTRF) must be called first to supply the Cholesky factorized form. The storage (upper or lower triangular) used by F07HDF (DPBTRF) is relevant as this determines which elements of the stored factorized form are referenced.

2  Specification

REAL (KIND=nag_wp)  AB(LDAB,*), D

3  Description

The determinant of A is calculated using the Cholesky factorization A=UTU, where U is an upper triangular band matrix, or A=LLT, where L is a lower triangular band matrix. The determinant of A is the product of the squares of the diagonal elements of U or L.

4  References

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

5  Parameters

1:     UPLO – CHARACTER(1)Input
On entry: indicates whether the upper or lower triangular part of A was stored and how it was factorized. This should not be altered following a call to F07HDF (DPBTRF).
The upper triangular part of A was originally stored and A was factorized as UTU where U is upper triangular.
The lower triangular part of A was originally stored and A was factorized as LLT where L is lower triangular.
Constraint: UPLO='U' or 'L'.
2:     N – INTEGERInput
On entry: n, the order of the matrix A.
Constraint: N>0.
3:     KD – INTEGERInput
On entry: kd, the number of superdiagonals or subdiagonals of the matrix A.
Constraint: KD0.
4:     AB(LDAB,*) – REAL (KIND=nag_wp) arrayInput
Note: the second dimension of the array AB must be at least max1,N.
On entry: the Cholesky factor of A, as returned by F07HDF (DPBTRF).
5:     LDAB – INTEGERInput
On entry: the first dimension of the array AB as declared in the subprogram from which F03BHF is called.
Constraint: LDABKD+1.
6:     D – REAL (KIND=nag_wp)Output
7:     ID – INTEGEROutput
On exit: the determinant of A is given by D×2.0ID. It is given in this form to avoid overflow or underflow.
8:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
On entry,UPLO'L' or 'U'.
On entry,N<1.
On entry,KD<0.
On entry,LDAB<KD+1.
The matrix A is not positive definite.

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

8  Further Comments

The time taken by F03BHF is approximately proportional to n.
This routine should only be used when mn since as m approaches n, it becomes less efficient to take advantage of the band form.

9  Example

This example calculates the determinant of the real symmetric positive definite band matrix
5 -4 1 -4 6 -4 1 1 -4 6 -4 1 1 -4 6 -4 1 1 -4 6 -4 1 1 -4 6 -4 1 -4 5 .

9.1  Program Text

Program Text (f03bhfe.f90)

9.2  Program Data

Program Data (f03bhfe.d)

9.3  Program Results

Program Results (f03bhfe.r)

F03BHF (PDF version)
F03 Chapter Contents
F03 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012