NAG CL Interface
f03bhc (real_​band_​sym)

1 Purpose

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

2 Specification

#include <nag.h>
void  f03bhc (Nag_OrderType order, Nag_UploType uplo, Integer n, Integer kd, const double ab[], Integer pdab, double *d, Integer *id, NagError *fail)
The function may be called by the names: f03bhc or nag_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: order Nag_OrderType Input
On entry: the order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by order=Nag_RowMajor. See Section 3.1.3 in the Introduction to the NAG Library CL Interface for a more detailed explanation of the use of this argument.
Constraint: order=Nag_RowMajor or Nag_ColMajor.
2: uplo Nag_UploType 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 f07hdc.
uplo=Nag_Upper
The upper triangular part of A was originally stored and A was factorized as UTU where U is upper triangular.
uplo=Nag_Lower
The lower triangular part of A was originally stored and A was factorized as LLT where L is lower triangular.
Constraint: uplo=Nag_Upper or Nag_Lower.
3: n Integer Input
On entry: n, the order of the matrix A.
Constraint: n>0.
4: kd Integer Input
On entry: kd, the number of superdiagonals or subdiagonals of the matrix A.
Constraint: kd0.
5: ab[dim] const double Input
Note: the dimension, dim, of the array ab must be at least max1,pdab×n.
On entry: the Cholesky factor of A, as returned by f07hdc.
6: pdab Integer Input
On entry: the stride separating row or column elements (depending on the value of order) of the matrix in the array ab.
Constraint: pdabkd+1.
7: d double * Output
8: 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.
9: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_INT
On entry, kd=value.
Constraint: kd0.
On entry, n=value.
Constraint: n>0.
NE_INT_2
On entry, pdab=value and kd=value.
Constraint: pdabkd+1.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_MAT_NOT_POS_DEF
The matrix A is not positive definite.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL 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

f03bhc is not threaded in any implementation.

9 Further Comments

The time taken by f03bhc is approximately proportional to n.
This function 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 (f03bhce.c)

10.2 Program Data

Program Data (f03bhce.d)

10.3 Program Results

Program Results (f03bhce.r)