NAG Library Routine Document
F04MCF
1 Purpose
F04MCF 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
F01MCF. Related systems may also be solved.
2 Specification
SUBROUTINE F04MCF ( |
N, AL, LAL, D, NROW, IR, B, LDB, ISELCT, X, LDX, IFAIL) |
INTEGER |
N, LAL, NROW(N), IR, LDB, ISELCT, LDX, IFAIL |
REAL (KIND=nag_wp) |
AL(LAL), D(*), B(LDB,IR), X(LDX,IR) |
|
3 Description
The normal use of this routine is the solution of the systems
, following a call of
F01MCF to determine the Cholesky factorization
of the symmetric positive definite variable-bandwidth matrix
.
However, the routine may be used to solve any one of the following systems of linear algebraic equations:
- (usual system),
- (lower triangular system),
- (upper triangular system),
- (unit lower triangular system),
- (unit upper triangular system).
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 9 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 Parameters
- 1: N – INTEGERInput
On entry: , the order of the matrix .
Constraint:
.
- 2: AL(LAL) – REAL (KIND=nag_wp) arrayInput
On entry: the elements within the envelope of the lower triangular matrix
, taken in row by row order, as returned by
F01MCF. The unit diagonal elements of
must be stored explicitly.
- 3: LAL – INTEGERInput
On entry: the dimension of the array
AL as declared in the (sub)program from which F04MCF is called.
Constraint:
.
- 4: D() – REAL (KIND=nag_wp) arrayInput
-
Note: the dimension of the array
D
must be at least
if
, and at least
otherwise.
On entry: the diagonal elements of the diagonal matrix
.
D is not referenced if
.
- 5: NROW(N) – INTEGER arrayInput
On entry: must contain the width of row of , i.e., the number of elements between the first (leftmost) nonzero element and the element on the diagonal, inclusive.
Constraint:
.
- 6: IR – INTEGERInput
On entry: , the number of right-hand sides.
Constraint:
.
- 7: B(LDB,IR) – REAL (KIND=nag_wp) arrayInput
On entry: the
by
right-hand side matrix
. See also
Section 8.
- 8: LDB – INTEGERInput
On entry: the first dimension of the array
B as declared in the (sub)program from which F04MCF is called.
Constraint:
.
- 9: ISELCT – INTEGERInput
On entry: must specify the type of system to be solved, as follows:
- Solve .
- Solve .
- Solve .
- Solve .
- Solve .
- Solve .
Constraint:
, , , , or .
- 10: X(LDX,IR) – REAL (KIND=nag_wp) arrayOutput
On exit: the
by
solution matrix
. See also
Section 8.
- 11: LDX – INTEGERInput
On entry: the first dimension of the array
X as declared in the (sub)program from which F04MCF is called.
Constraint:
.
- 12: 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 | for some , or , |
or | . |
On entry, | , |
or | , |
or | . |
On entry, | , |
or | . |
The diagonal matrix
is singular, i.e., at least one of the elements of
D is zero. This can only occur if
.
At least one of the diagonal elements of is not equal to unity.
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)).
The time taken by F04MCF is approximately proportional to , where .
Unless otherwise stated in the
Users' Note for your implementation, the routine may be called with the same actual array supplied for the parameters
B and
X, in which case the solution matrix will overwrite the right-hand side matrix. However this is not standard Fortran and may not work in all implementations.
9 Example
This example solves the system of equations
, where
Here
is symmetric and positive definite and must first be factorized by
F01MCF.
9.1 Program Text
Program Text (f04mcfe.f90)
9.2 Program Data
Program Data (f04mcfe.d)
9.3 Program Results
Program Results (f04mcfe.r)