NAG Library Routine Document

f03bhf (real_band_sym)

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

Fortran Interface
Subroutine f03bhf ( uplo, n, kd, ab, ldab, d, id, ifail)
Integer, Intent (In):: n, kd, ldab
Integer, Intent (Inout):: ifail
Integer, Intent (Out):: id
Real (Kind=nag_wp), Intent (In):: ab(ldab,*)
Real (Kind=nag_wp), Intent (Out):: d
Character (1), Intent (In):: uplo
C Header Interface
#include <nagmk26.h>
void  f03bhf_ (const char *uplo, const Integer *n, const Integer *kd, const double ab[], const Integer *ldab, double *d, Integer *id, Integer *ifail, const Charlen length_uplo)

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
Arguments

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).
uplo='U'
The upper triangular part of A was originally stored and A was factorized as UTU where U is upper triangular.
uplo='L'
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:     abldab* – 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 argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation 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 argument, 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:
ifail=1
On entry, uplo=value.
Constraint: uplo='L' or 'U'.
ifail=2
On entry, n=value.
Constraint: n>0.
ifail=3
On entry, kd=value.
Constraint: kd0.
ifail=5
On entry, ldab=value and kd=value.
Constraint: ldabkd+1.
ifail=6
The matrix A is not positive definite.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

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
Parallelism and Performance

f03bhf is not threaded in any implementation.

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

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

10.1
Program Text

Program Text (f03bhfe.f90)

10.2
Program Data

Program Data (f03bhfe.d)

10.3
Program Results

Program Results (f03bhfe.r)