NAG Library Routine Document
F03BHF
Note: before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.
1 Purpose
F03BHF computes the determinant of a
by
symmetric positive definite banded matrix
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
INTEGER
N, KD, LDAB, ID, IFAIL
REAL (KIND=nag_wp)
AB(LDAB,*), D
CHARACTER(1)
UPLO
3 Description
The determinant of is calculated using the Cholesky factorization , where is an upper triangular band matrix, or , where is a lower triangular band matrix. The determinant of is the product of the squares of the diagonal elements of or .
4 References
Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag
5 Parameters
- 1: UPLO – CHARACTER(1)Input
On entry: indicates whether the upper or lower triangular part of
was stored and how it was factorized. This should not be altered following a call to
F07HDF (DPBTRF).
- The upper triangular part of was originally stored and was factorized as where is upper triangular.
- The lower triangular part of was originally stored and was factorized as where is lower triangular.
Constraint:
or .
- 2: N – INTEGERInput
On entry: , the order of the matrix .
Constraint:
.
- 3: KD – INTEGERInput
On entry: , the number of superdiagonals or subdiagonals of the matrix .
Constraint:
.
- 4: AB(LDAB,) – REAL (KIND=nag_wp) arrayInput
-
Note: the second dimension of the array
AB
must be at least
.
- 5: LDAB – INTEGERInput
On entry: the first dimension of the array
AB as declared in the subprogram from which F03BHF is called.
Constraint:
.
- 6: D – REAL (KIND=nag_wp)Output
- 7: ID – INTEGEROutput
On exit: the determinant of is given by . It is given in this form to avoid overflow or underflow.
- 8: IFAIL – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
.
When the value is used it is essential to test the value of IFAIL on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6 Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Errors or warnings detected by the routine:
On entry, or .
On entry, .
On entry, .
On entry, .
The matrix 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).
The time taken by F03BHF is approximately proportional to .
This routine should only be used when since as approaches , 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
9.1 Program Text
Program Text (f03bhfe.f90)
9.2 Program Data
Program Data (f03bhfe.d)
9.3 Program Results
Program Results (f03bhfe.r)