NAG FL Interface
f04mcf (real_posdef_vband_solve)
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
Fortran Interface
Subroutine f04mcf ( |
n, al, lal, d, nrow, ir, b, ldb, iselct, x, ldx, ifail) |
Integer, Intent (In) |
:: |
n, lal, nrow(n), ir, ldb, iselct, ldx |
Integer, Intent (Inout) |
:: |
ifail |
Real (Kind=nag_wp), Intent (In) |
:: |
al(lal), d(*), b(ldb,ir) |
Real (Kind=nag_wp), Intent (Inout) |
:: |
x(ldx,ir) |
|
C Header Interface
#include <nag.h>
void |
f04mcf_ (const Integer *n, const double al[], const Integer *lal, const double d[], const Integer nrow[], const Integer *ir, const double b[], const Integer *ldb, const Integer *iselct, double x[], const Integer *ldx, Integer *ifail) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
f04mcf_ (const Integer &n, const double al[], const Integer &lal, const double d[], const Integer nrow[], const Integer &ir, const double b[], const Integer &ldb, const Integer &iselct, double x[], const Integer &ldx, Integer &ifail) |
}
|
The routine may be called by the names f04mcf or nagf_linsys_real_posdef_vband_solve.
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
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 triangular matrix
, taken in row by row order, as returned by
f01mcf. The unit diagonal elements of
must be stored explicitly.
-
3:
– Integer
Input
-
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) array
Input
-
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 array
Input
-
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:
– Integer
Input
-
On entry: , the number of right-hand sides.
Constraint:
.
-
7:
– Real (Kind=nag_wp) array
Input
-
On entry: the
by
right-hand side matrix
. See also
Section 9.
-
8:
– Integer
Input
-
On entry: the first dimension of the array
b as declared in the (sub)program from which
f04mcf is called.
Constraint:
.
-
9:
– Integer
Input
-
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) array
Output
-
On exit: the
by
solution matrix
. See also
Section 9.
-
11:
– Integer
Input
-
On entry: the first dimension of the array
x as declared in the (sub)program from which
f04mcf is called.
Constraint:
.
-
12:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
or
to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value
or
is recommended. If message printing is undesirable, then the value
is recommended. Otherwise, the value
is recommended.
When the value or 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: .
-
On entry, .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
-
On entry, .
Constraint: and .
-
On entry, .
Constraint: .
-
At least one diagonal entry of
al is not unit.
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
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
f04mcf is not threaded in any implementation.
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 arguments
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
10.2
Program Data
10.3
Program Results