NAG FL Interface
f03bhf (real_​band_​sym)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

f03bhf computes the determinant of an n×n symmetric positive definite banded matrix A that has been stored in band-symmetric storage. f07hdf must be called first to supply the Cholesky factorized form. The storage (upper or lower triangular) used by f07hdf 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 <nag.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)
The routine may be called by the names f03bhf or nagf_det_real_band_sym.

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.
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 Integer Input
On entry: n, the order of the matrix A.
Constraint: n>0.
3: kd Integer Input
On entry: kd, the number of superdiagonals or subdiagonals of the matrix A.
Constraint: kd0.
4: ab(ldab,*) Real (Kind=nag_wp) array Input
Note: the second dimension of the array ab must be at least max(1,n).
On entry: the Cholesky factor of A, as returned by f07hdf.
5: ldab Integer Input
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 Integer Output
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 Integer Input/Output
On entry: ifail must be set to 0, −1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of −1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value −1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value 0 is recommended. 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 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface 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)