NAG Library Function Document
nag_real_cholesky_skyline_solve (f04mcc)
1
Purpose
nag_real_cholesky_skyline_solve (f04mcc) computes the approximate solution of a system of real linear equations with multiple right-hand sides,
, where
is a symmetric positive definite variable-bandwidth matrix, which has previously been factorized by
nag_real_cholesky_skyline (f01mcc). Related systems may also be solved.
2
Specification
#include <nag.h> |
#include <nagf04.h> |
void |
nag_real_cholesky_skyline_solve (Nag_SolveSystem selct,
Integer n,
Integer nrhs,
const double al[],
Integer lal,
const double d[],
const Integer row[],
const double b[],
Integer tdb,
double x[],
Integer tdx,
NagError *fail) |
|
3
Description
The normal use of
nag_real_cholesky_skyline_solve (f04mcc) is the solution of the systems
, following a call of
nag_real_cholesky_skyline (f01mcc) to determine the Cholesky factorization
of the symmetric positive definite variable-bandwidth matrix
.
However, the function may be used to solve any one of the following systems of linear algebraic equations:
denotes a unit lower triangular variable-bandwidth matrix of order , a diagonal matrix of order , and a set of right-hand sides.
The matrix
is represented by the elements lying within its
envelope, i.e., 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.
4
References
Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag
5
Arguments
- 1:
– Nag_SolveSystemInput
-
On entry:
selct must specify the type of system to be solved, as follows:
- if : solve ;
- if : solve ;
- if : solve ;
- if : solve ;
- if : solve ;
- if : solve .
Constraint:
, , , , or .
- 2:
– IntegerInput
-
On entry: , the order of the matrix .
Constraint:
.
- 3:
– IntegerInput
-
On entry: , the number of right-hand sides.
Constraint:
.
- 4:
– const doubleInput
-
On entry: the elements within the envelope of the lower triangular matrix
, taken in row by row order, as returned by
nag_real_cholesky_skyline (f01mcc). The unit diagonal elements of
must be stored explicitly.
- 5:
– IntegerInput
-
On entry: the dimension of the array
al.
Constraint:
.
- 6:
– const doubleInput
-
On entry: the diagonal elements of the diagonal matrix
.
d is not referenced if
,
or
- 7:
– const IntegerInput
-
On entry: must contain the width of row of , i.e., the number of elements between the first (left-most) nonzero element and the element on the diagonal, inclusive.
Constraint:
for .
- 8:
– const doubleInput
-
Note: the th element of the matrix is stored in .
On entry: the
by
right-hand side matrix
. See also
Section 9.
- 9:
– IntegerInput
-
On entry: the stride separating matrix column elements in the array
b.
Constraint:
.
- 10:
– doubleOutput
-
Note: the th element of the matrix is stored in .
On exit: the
by
solution matrix
. See also
Section 9.
- 11:
– IntegerInput
-
On entry: the stride separating matrix column elements in the array
x.
Constraint:
.
- 12:
– NagError *Input/Output
-
The NAG error argument (see
Section 3.7 in How to Use the NAG Library and its Documentation).
6
Error Indicators and Warnings
- NE_2_INT_ARG_GT
-
On entry, while . These arguments must satisfy .
- NE_2_INT_ARG_LT
-
On entry, while . These arguments must satisfy .
On entry, while . These arguments must satisfy .
On entry, while . These arguments must satisfy .
- NE_BAD_PARAM
-
On entry, argument
selct had an illegal value.
- NE_INT_ARG_LT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, must not be less than 1: .
- NE_NOT_UNIT_DIAG
-
The lower triangular matrix has at least one diagonal element which is not equal to unity. The first non-unit element has been located in the array .
- NE_ZERO_DIAG
-
The diagonal matrix is singular as it has at least one zero element. The first zero element has been located in the array .
7
Accuracy
The usual backward error analysis of the solution of triangular system applies: each computed solution vector is exact for slightly perturbed matrices
and
, as appropriate (see pages 25-27 and 54-55 of
Wilkinson and Reinsch (1971)).
8
Parallelism and Performance
nag_real_cholesky_skyline_solve (f04mcc) is not threaded in any implementation.
The time taken by nag_real_cholesky_skyline_solve (f04mcc) is approximately proportional to , where .
The function may be called with the same actual array supplied for the arguments
b and
x, in which case the solution matrix will overwrite the right-hand side matrix.
10
Example
To solve the system of equations
, where
Here
is symmetric and positive definite and must first be factorized by
nag_real_cholesky_skyline (f01mcc).
10.1
Program Text
Program Text (f04mcce.c)
10.2
Program Data
Program Data (f04mcce.d)
10.3
Program Results
Program Results (f04mcce.r)