NAG FL Interface
f01mcf (real_vband_posdef_fac)
1
Purpose
f01mcf computes the Cholesky factorization of a real symmetric positive definite variable-bandwidth matrix.
2
Specification
Fortran Interface
Integer, Intent (In) |
:: |
n, lal |
Integer, Intent (Inout) |
:: |
nrow(n), ifail |
Real (Kind=nag_wp), Intent (In) |
:: |
a(lal) |
Real (Kind=nag_wp), Intent (Out) |
:: |
al(lal), d(n) |
|
C Header Interface
#include <nag.h>
void |
f01mcf_ (const Integer *n, const double a[], const Integer *lal, Integer nrow[], double al[], double d[], Integer *ifail) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
f01mcf_ (const Integer &n, const double a[], const Integer &lal, Integer nrow[], double al[], double d[], Integer &ifail) |
}
|
The routine may be called by the names f01mcf or nagf_matop_real_vband_posdef_fac.
3
Description
f01mcf determines the unit lower triangular matrix and the diagonal matrix in the Cholesky factorization of a symmetric positive definite variable-bandwidth matrix of order . (Such a matrix is sometimes called a ‘sky-line’ matrix.)
The matrix
is represented by the elements lying within the
envelope of its lower triangular part, that is, between the first nonzero of each row and the diagonal (see
Section 10 for an example). The
width
of the
th row is the number of elements between the first nonzero element and the element on the diagonal, inclusive. Although, of course, any matrix possesses an envelope as defined, this routine is primarily intended for the factorization of symmetric positive definite matrices with an
average bandwidth which is small compared with
(also see
Section 9).
The method is based on the property that during Cholesky factorization there is no fill-in outside the envelope.
The determination of
and
is normally the first of two steps in the solution of the system of equations
. The remaining step, viz. the solution of
, may be carried out using
f04mcf.
4
References
Jennings A (1966) A compact storage scheme for the solution of symmetric linear simultaneous equations Comput. J. 9 281–285
Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag
5
Arguments
-
1:
– Integer
Input
-
On entry: , the order of the matrix .
Constraint:
.
-
2:
– Real (Kind=nag_wp) array
Input
-
On entry: the elements within the envelope of the lower triangle of the positive definite symmetric matrix
, taken in row by row order.
The following code assigns the matrix elements within the envelope to the correct elements of the array:
k = 0
Do 20 i = 1, n
Do 10 j = i-nrow(i)+1, i
k = k + 1
a(k) = matrix (i,j)
10 Continue
20 Continue
-
3:
– Integer
Input
-
On entry: the dimension of the arrays
a and
al as declared in the (sub)program from which
f01mcf is called.
Constraint:
.
-
4:
– Integer array
Input
-
On entry: must contain the width of row of the matrix , i.e., the number of elements between the first (leftmost) nonzero element and the element on the diagonal, inclusive.
Constraint:
, for .
-
5:
– Real (Kind=nag_wp) array
Output
-
On exit: the elements within the envelope of the lower triangular matrix
, taken in row by row order. The envelope of
is identical to that of the lower triangle of
. The unit diagonal elements of
are stored explicitly. See also
Section 9.
-
6:
– Real (Kind=nag_wp) array
Output
-
On exit: the diagonal elements of the diagonal matrix . Note that the determinant of is equal to the product of these diagonal elements. If the value of the determinant is required it should not be determined by forming the product explicitly, because of the possibility of overflow or underflow. The logarithm of the determinant may safely be formed from the sum of the logarithms of the diagonal elements.
-
7:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 4 in the Introduction to the NAG Library FL Interface 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 argument, 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, and .
Constraint: and .
On entry, and .
Constraint: .
On entry, .
Constraint: .
-
is not positive definite. Factorization abandoned.
-
is not positive definite. Factorization completed.
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.
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.
Dynamic memory allocation failed.
See
Section 9 in the Introduction to the NAG Library FL Interface for further information.
7
Accuracy
If
on exit, then the
computed
and
satisfy the relation
, where
and
where
is a constant of order unity,
is the largest value of
, and
is the
machine precision. See pages 25–27 and 54–55 of
Wilkinson and Reinsch (1971).
8
Parallelism and Performance
f01mcf is not threaded in any implementation.
The time taken by f01mcf is approximately proportional to the sum of squares of the values of .
The distribution of row widths may be very non-uniform without undue loss of efficiency. Moreover, the routine has been designed to be as competitive as possible in speed with routines designed for full or uniformly banded matrices, when applied to such matrices.
Unless otherwise stated in the
Users' Note for your implementation, the routine may be called with the same actual array supplied for arguments
a and
al, in which case
overwrites the lower triangle of
a. However this is not standard Fortran and may not work in all implementations.
10
Example
This example obtains the Cholesky factorization of the symmetric matrix, whose lower triangle is:
For this matrix, the elements of
nrow must be set to
,
,
,
,
,
, and the elements within the envelope must be supplied in row order as:
10.1
Program Text
10.2
Program Data
10.3
Program Results