nag_det_real_band_sym (f03bhc) (PDF version)
f03 Chapter Contents
f03 Chapter Introduction
NAG 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:     order Nag_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 2.3.1.3 in How to Use the NAG Library and its Documentation for a more detailed explanation of the use of this argument.
Constraint: order=Nag_RowMajor or Nag_ColMajor.
2:     uplo Nag_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:     n IntegerInput
On entry: n, the order of the matrix A.
Constraint: n>0.
4:     kd IntegerInput
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:     pdab IntegerInput
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 2.7 in How to Use the NAG Library and its Documentation).

6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 2.3.1.2 in How to Use the NAG Library and its Documentation 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.
An unexpected error has been triggered by this function. Please contact NAG.
See Section 2.7.6 in How to Use the NAG Library and its Documentation 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 2.7.5 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

nag_det_real_band_sym (f03bhc) is not threaded in any implementation.

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

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)


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

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