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.
The routine may be called by the names f11mhf or nagf_sparse_direct_real_gen_refine.
3Description
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-wiseforward 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.
4References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
5Arguments
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: the new column index array of sparse matrix . 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 . See Section 2.1.3 in the F11 Chapter Introduction.
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 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 solution matrix , as returned by f11mff.
On exit: the 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 , 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).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
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.
7Accuracy
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.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
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.
9Further Comments
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 ;
10Example
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.