nag_det_real_band_sym (f03bhc) (PDF version)
f03 Chapter Contents
f03 Chapter Introduction
NAG C Library Manual

NAG Library Function Document

nag_det_real_band_sym (f03bhc)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

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

2  Specification

#include <nag.h>
#include <nagf03.h>
void  nag_det_real_band_sym (Nag_OrderType order, Nag_UploType uplo, Integer n, Integer kd, const double ab[], Integer pdab, double *d, Integer *id, NagError *fail)

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:     orderNag_OrderTypeInput
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.2.1.3 in the Essential Introduction for a more detailed explanation of the use of this argument.
Constraint: order=Nag_RowMajor or Nag_ColMajor.
2:     uploNag_UploTypeInput
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 nag_dpbtrf (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:     nIntegerInput
On entry: n, the order of the matrix A.
Constraint: n>0.
4:     kdIntegerInput
On entry: kd, the number of superdiagonals or subdiagonals of the matrix A.
Constraint: kd0.
5:     ab[dim]const doubleInput
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 nag_dpbtrf (f07hdc).
6:     pdabIntegerInput
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:     ddouble *Output
8:     idInteger *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:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

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.
NE_MAT_NOT_POS_DEF
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 nag_det_real_band_sym (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.

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 (f03bhce.c)

9.2  Program Data

Program Data (f03bhce.d)

9.3  Program Results

Program Results (f03bhce.r)


nag_det_real_band_sym (f03bhc) (PDF version)
f03 Chapter Contents
f03 Chapter Introduction
NAG C Library Manual

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