NAG FL Interface
f11mff (direct_​real_​gen_​solve)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

f11mff solves a real sparse system of linear equations with multiple right-hand sides given an LU factorization of the sparse matrix computed by f11mef.

2 Specification

Fortran Interface
Subroutine f11mff ( trans, n, iprm, il, lval, iu, uval, nrhs, b, ldb, ifail)
Integer, Intent (In) :: n, iprm(7*n), il(*), iu(*), nrhs, ldb
Integer, Intent (Inout) :: ifail
Real (Kind=nag_wp), Intent (In) :: lval(*), uval(*)
Real (Kind=nag_wp), Intent (Inout) :: b(ldb,*)
Character (1), Intent (In) :: trans
C Header Interface
#include <nag.h>
void  f11mff_ (const char *trans, const Integer *n, const Integer iprm[], const Integer il[], const double lval[], const Integer iu[], const double uval[], const Integer *nrhs, double b[], const Integer *ldb, Integer *ifail, const Charlen length_trans)
The routine may be called by the names f11mff or nagf_sparse_direct_real_gen_solve.

3 Description

f11mff solves a real system of linear equations with multiple right-hand sides AX=B or ATX=B, according to the value of the argument trans, where the matrix factorization Pr A Pc = LU corresponds to an LU decomposition of a sparse matrix stored in compressed column (Harwell–Boeing) format, as computed by f11mef.
In the above decomposition L is a lower triangular sparse matrix with unit diagonal elements and U is an upper triangular sparse matrix; Pr and Pc are permutation matrices.

4 References

None.

5 Arguments

1: trans Character(1) Input
On entry: specifies whether AX=B or ATX=B is solved.
trans='N'
AX=B is solved.
trans='T'
ATX=B is solved.
Constraint: trans='N' or 'T'.
2: n Integer Input
On entry: n, the order of the matrix A.
Constraint: n0.
3: iprm(7×n) Integer array Input
On entry: the column permutation which defines Pc, the row permutation which defines Pr, plus associated data structures as computed by f11mef.
4: il(*) Integer array Input
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 L as computed by f11mef.
5: lval(*) Real (Kind=nag_wp) array Input
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 L and some nonzero values of matrix U as computed by f11mef.
6: iu(*) Integer array Input
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 U as computed by f11mef.
7: uval(*) Real (Kind=nag_wp) array Input
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 U as computed by f11mef.
8: nrhs Integer Input
On entry: nrhs, the number of right-hand sides in B.
Constraint: nrhs0.
9: b(ldb,*) Real (Kind=nag_wp) array Input/Output
Note: the second dimension of the array b must be at least max(1,nrhs).
On entry: the n×nrhs right-hand side matrix B.
On exit: the n×nrhs solution matrix X.
10: ldb Integer Input
On entry: the first dimension of the array b as declared in the (sub)program from which f11mff is called.
Constraint: ldbmax(1,n).
11: ifail Integer Input/Output
On entry: ifail must be set to 0, −1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of −1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value −1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value 0 is recommended. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry ifail=0 or −1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
On entry, ldb=value and n=value.
Constraint: ldbmax(1,n).
On entry, n=value.
Constraint: n0.
On entry, nrhs=value.
Constraint: nrhs0.
On entry, trans=value.
Constraint: trans='N' or 'T'.
ifail=2
Incorrect row permutations in array iprm.
ifail=3
Incorrect column permutations in array iprm.
ifail=-99
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.
ifail=-399
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.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

7 Accuracy

For each right-hand side vector b, the computed solution x is the exact solution of a perturbed system of equations (A+E)x=b, where
|E|c(n)ε|L||U|,  
c(n) is a modest linear function of n, and ε is the machine precision, when partial pivoting is used.
If x^ is the true solution, then the computed solution x satisfies a forward error bound of the form
x-x^ x c(n)cond(A,x)ε  
where cond(A,x)=|A-1||A||x|/ xcond(A)=|A-1||A|κ (A). Note that cond(A,x) can be much smaller than cond(A), and cond(AT) can be much larger (or smaller) than cond(A).
Forward and backward error bounds can be computed by calling f11mhf, and an estimate for κ(A) can be obtained by calling f11mgf.

8 Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
f11mff is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
f11mff 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.

9 Further Comments

f11mff may be followed by a call to f11mhf to refine the solution and return an error estimate.

10 Example

This example solves the system of equations AX=B, where
A=( 2.00 1.00 0 0 0 0 0 1.00 -1.00 0 4.00 0 1.00 0 1.00 0 0 0 1.00 2.00 0 -2.00 0 0 3.00 )   and  B=( 1.56 3.12 -0.25 -0.50 3.60 7.20 1.33 2.66 0.52 1.04 ) .  
Here A is nonsymmetric and must first be factorized by f11mef.

10.1 Program Text

Program Text (f11mffe.f90)

10.2 Program Data

Program Data (f11mffe.d)

10.3 Program Results

Program Results (f11mffe.r)