NAG Library Routine Document
F11MHF
1 Purpose
F11MHF returns error bounds for the solution of a real sparse system of linear equations with multiple right-hand sides, or . It improves the solution by iterative refinement in standard precision, in order to reduce the backward error as much as possible.
2 Specification
SUBROUTINE F11MHF ( |
TRANS, N, ICOLZP, IROWIX, A, IPRM, IL, LVAL, IU, UVAL, NRHS, B, LDB, X, LDX, FERR, BERR, IFAIL) |
INTEGER |
N, ICOLZP(*), IROWIX(*), IPRM(7*N), IL(*), IU(*), NRHS, LDB, LDX, IFAIL |
REAL (KIND=nag_wp) |
A(*), LVAL(*), UVAL(*), B(LDB,*), X(LDX,*), FERR(NRHS), BERR(NRHS) |
CHARACTER(1) |
TRANS |
|
3 Description
F11MHF returns the backward errors and estimated bounds on the forward errors for the solution of a real system of linear equations with multiple right-hand sides or . The routine handles each right-hand side vector (stored as a column of the matrix ) independently, so we describe the function of F11MHF in terms of a single right-hand side and solution .
Given a computed solution
, the routine computes the
component-wise backward error
. This is the size of the smallest relative perturbation in each element of
and
such that if
is the exact solution of a perturbed system:
Then the routine estimates a bound for the
component-wise forward error in the computed solution, defined by:
where
is the true solution.
The routine uses the
factorization
computed by
F11MEF and the solution computed by
F11MFF.
4 References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
5 Parameters
- 1: – CHARACTER(1)Input
-
On entry: specifies whether
or
is solved.
- is solved.
- is solved.
Constraint:
or .
- 2: – INTEGERInput
-
On entry: , the order of the matrix .
Constraint:
.
- 3: – INTEGER arrayInput
-
Note: the dimension of the array
ICOLZP
must be at least
.
On entry:
contains the index in
of the start of a new column. See
Section 2.1.3 in the F11 Chapter Introduction.
- 4: – INTEGER arrayInput
-
Note: the dimension of the array
IROWIX
must be at least
, the number of nonzeros of the sparse matrix
.
On entry: the row index array of sparse matrix .
- 5: – REAL (KIND=nag_wp) arrayInput
-
Note: the dimension of the array
A
must be at least
, the number of nonzeros of the sparse matrix
.
On entry: the array of nonzero values in the sparse matrix .
- 6: – INTEGER arrayInput
-
On entry: the column permutation which defines
, the row permutation which defines
, plus associated data structures as computed by
F11MEF.
- 7: – INTEGER arrayInput
-
Note: the dimension of the array
IL
must be at least
as large as the dimension of the array of the same name in
F11MEF.
On entry: records the sparsity pattern of matrix
as computed by
F11MEF.
- 8: – REAL (KIND=nag_wp) arrayInput
-
Note: the dimension of the array
LVAL
must be at least
as large as the dimension of the array of the same name in
F11MEF.
On entry: records the nonzero values of matrix
and some nonzero values of matrix
as computed by
F11MEF.
- 9: – INTEGER arrayInput
-
Note: the dimension of the array
IU
must be at least
as large as the dimension of the array of the same name in
F11MEF.
On entry: records the sparsity pattern of matrix
as computed by
F11MEF.
- 10: – REAL (KIND=nag_wp) arrayInput
-
Note: the dimension of the array
UVAL
must be at least
as large as the dimension of the array of the same name in
F11MEF.
On entry: records some nonzero values of matrix
as computed by
F11MEF.
- 11: – INTEGERInput
-
On entry: , the number of right-hand sides in .
Constraint:
.
- 12: – REAL (KIND=nag_wp) arrayInput
-
Note: the second dimension of the array
B
must be at least
.
On entry: the by right-hand side matrix .
- 13: – INTEGERInput
-
On entry: the first dimension of the array
B as declared in the (sub)program from which F11MHF is called.
Constraint:
.
- 14: – REAL (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
X
must be at least
.
On entry: the
by
solution matrix
, as returned by
F11MFF.
On exit: the by improved solution matrix .
- 15: – INTEGERInput
-
On entry: the first dimension of the array
X as declared in the (sub)program from which F11MHF is called.
Constraint:
.
- 16: – REAL (KIND=nag_wp) arrayOutput
-
On exit: contains an estimated error bound for the th solution vector, that is, the th column of , for .
- 17: – REAL (KIND=nag_wp) arrayOutput
-
On exit: contains the component-wise backward error bound for the th solution vector, that is, the th column of , for .
- 18: – 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 , |
or | , |
or | , |
or | , |
or | . |
-
Ill-defined row permutation in array . Internal checks have revealed that the array is corrupted.
-
Ill-defined column permutations in array . Internal checks have revealed that the array is corrupted.
-
Unable to allocate required internal workspace.
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 bounds returned in
FERR are not rigorous, because they are estimated, not computed exactly; but in practice they almost always overestimate the actual error.
8 Parallelism and Performance
F11MHF is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
F11MHF makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
At most five steps of iterative refinement are performed, but usually only one or two steps are required.
Estimating the forward error involves solving a number of systems of linear equations of the form or ;
10 Example
This example solves the system of equations
using iterative refinement and to compute the forward and backward error bounds, where
Here
is nonsymmetric and must first be factorized by
F11MEF.
10.1 Program Text
Program Text (f11mhfe.f90)
10.2 Program Data
Program Data (f11mhfe.d)
10.3 Program Results
Program Results (f11mhfe.r)