NAG Library Routine Document
F04AXF calculates the approximate solution of a set of real sparse linear equations with a single right-hand side,
has been factorized by F01BRF
||N, LICN, ICN(LICN), IKEEP(5*N), MTYPE, IDISP(2)
||A(LICN), RHS(N), W(N), RESID
To solve a system of real linear equations
is a general sparse matrix,
must first be factorized by F01BRF
. F04AXF then computes
by block forward or backward substitution using simple forward and backward substitution within each diagonal block.
The method is fully described in Duff (1977)
A more recent method is available through solver routine F11MFF
and factorization routine F11MEF
Duff I S (1977) MA28 – a set of Fortran subroutines for sparse unsymmetric linear equations AERE Report R8730 HMSO
- 1: N – INTEGERInput
On entry: , the order of the matrix .
- 2: A(LICN) – REAL (KIND=nag_wp) arrayInput
: the nonzero elements in the factorization of the matrix
, as returned by F01BRF
- 3: LICN – INTEGERInput
: the dimension of the arrays A
as declared in the (sub)program from which F04AXF is called.
- 4: ICN(LICN) – INTEGER arrayCommunication Array
: the column indices of the nonzero elements of the factorization, as returned by F01BRF
- 5: IKEEP() – INTEGER arrayInput
provides, on entry, indexing information about the factorization, as returned by F01BRF
. Used as internal workspace prior to being restored and hence is unchanged.
- 6: RHS(N) – REAL (KIND=nag_wp) arrayInput/Output
On entry: the right-hand side vector .
is overwritten by the solution vector
- 7: W(N) – REAL (KIND=nag_wp) arrayWorkspace
- 8: MTYPE – INTEGERInput
specifies the task to be performed.
- Solve .
- Solve .
- 9: IDISP() – INTEGER arrayCommunication Array
: the values returned in IDISP
- 10: RESID – REAL (KIND=nag_wp)Output
: the value of the maximum residual,
, over all the unsatisfied equations, in case F01BRF
has been used to factorize a singular or rectangular matrix.
6 Error Indicators and Warnings
If an error is detected in an input parameter F04AXF will act as if a soft noisy exit has been requested (see Section 3.3.4
in the Essential Introduction).
The accuracy of the computed solution depends on the conditioning of the original matrix. Since F04AXF is always used with either F01BRF
, you are recommended to set
on entry to these routines and to examine the value of
on exit (see F01BRF
). For a detailed error analysis see page 17 of Duff (1977)
If storage for the original matrix is available then the error can be estimated by calculating the residual
and calling F04AXF again to find a correction
If the factorized form contains nonzeros () then the time taken is very approximately times longer than the inner loop of full matrix code. Some advantage is taken of zeros in the right-hand side when solving ().
This example solves the set of linear equations
The nonzero elements of
and indexing information are read in by the program, as described in the document for F01BRF
9.1 Program Text
Program Text (f04axfe.f90)
9.2 Program Data
Program Data (f04axfe.d)
9.3 Program Results
Program Results (f04axfe.r)