NAG Library Function Document
nag_real_cholesky_skyline (f01mcc) computes the Cholesky factorization of a real symmetric positive definite variable-bandwidth matrix.
||nag_real_cholesky_skyline (Integer n,
const double a,
nag_real_cholesky_skyline (f01mcc) 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.)
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 9
for an example). The width
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 function is primarily intended for the factorization of symmetric positive definite matrices with an average
bandwidth which is small compared with
(also see Section 8
The method is based on the property that during Cholesky factorization there is no fill-in outside the envelope.
The determination of
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 nag_real_cholesky_skyline_solve (f04mcc)
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
n – IntegerInput
On entry: , the order of the matrix .
a[lal] – const doubleInput
: 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
for(i=0; i<n; ++i)
for(j=i-row[i]+1; j<=i; ++j)
See also Section 8
lal – IntegerInput
: the smaller of the dimensions of the arrays a
as declared in the function from which nag_real_cholesky_skyline (f01mcc) is called.
row[n] – IntegerInput
On entry: must contain the width of row of the matrix , i.e., the number of elements between the first (left-most) nonzero element and the element on the diagonal, inclusive.
, for .
al[lal] – doubleOutput
: 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 8
d[n] – doubleOutput
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.
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
On entry, while . These arguments must satisfy .
On entry, while . These arguments must satisfy .
On entry, .
On entry, must not be less than 1: .
The matrix is not positive definite, possibly due to rounding errors.
The matrix is not positive definite, possibly due to rounding errors. The factorization has been completed but may be very inaccurate.
On successful exit then the computed
satisfy the relation
is a constant of order unity,
is the largest value of
is the machine precision
. See pages 25–27 and 54–55 or Wilkinson and Reinsch (1971)
. If the error NE_NOT_POS_DEF_FACT
is reported then the factorization has been completed although the matrix was not positive definite. However the factorization may be very inaccurate and should be used only with great caution. For instance, if it is used to solve a set of equations
using nag_real_cholesky_skyline_solve (f04mcc)
, the residual vector
should be checked.
The time taken by nag_real_cholesky_skyline (f01mcc) 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 function has been designed to be as competitive as possible in speed with functions designed for full or uniformly banded matrices, when applied to such matrices.
The function may be called with the same actual array supplied for arguments a
, in which case
overwrites the lower triangle of
To obtain the Cholesky factorization of the symmetric matrix, whose lower triangle is
For this matrix, the elements of row
must be set to 1, 2, 2, 1, 5, 3, and the elements within the envelope must be supplied in row order as
9.1 Program Text
Program Text (f01mcce.c)
9.2 Program Data
Program Data (f01mcce.d)
9.3 Program Results
Program Results (f01mcce.r)