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:
1. |
(usual system), |
2. |
(lower triangular system), |
3. |
(upper triangular system), |
4. |
|
5. |
(unit lower triangular system), |
6. |
(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 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 Parameters
- 1: – INTEGERInput
-
On entry: , the order of the matrix .
Constraint:
.
- 2: – 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: – INTEGERInput
-
On entry: the dimension of the array
AL as declared in the (sub)program from which F04MCF is called.
Constraint:
.
- 4: – 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: – 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: – INTEGERInput
-
On entry: , the number of right-hand sides.
Constraint:
.
- 7: – REAL (KIND=nag_wp) arrayInput
-
On entry: the
by
right-hand side matrix
. See also
Section 9.
- 8: – INTEGERInput
-
On entry: the first dimension of the array
B as declared in the (sub)program from which F04MCF is called.
Constraint:
.
- 9: – INTEGERInput
-
On entry: must specify the type of system to be solved, as follows:
- Solve .
- Solve .
- Solve .
- Solve .
- Solve .
- Solve .
Constraint:
, , , , or .
- 10: – REAL (KIND=nag_wp) arrayOutput
-
On exit: the
by
solution matrix
. See also
Section 9.
- 11: – INTEGERInput
-
On entry: the first dimension of the array
X as declared in the (sub)program from which F04MCF is called.
Constraint:
.
- 12: – 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.
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 3.8 in the Essential Introduction for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 3.7 in the Essential Introduction for further information.
Dynamic memory allocation failed.
See
Section 3.6 in the Essential Introduction for further information.
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
Not applicable.
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.
10 Example
This example solves the system of equations
, where
Here
is symmetric and positive definite and must first be factorized by
F01MCF.
10.1 Program Text
Program Text (f04mcfe.f90)
10.2 Program Data
Program Data (f04mcfe.d)
10.3 Program Results
Program Results (f04mcfe.r)