NAG Library Routine Document
F11DEF solves a real sparse nonsymmetric system of linear equations, represented in coordinate storage format, using a restarted generalized minimal residual (RGMRES), conjugate gradient squared (CGS), stabilized bi-conjugate gradient (Bi-CGSTAB), or transpose-free quasi-minimal residual (TFQMR) method, without preconditioning, with Jacobi, or with SSOR preconditioning.
|SUBROUTINE F11DEF (
||METHOD, PRECON, N, NNZ, A, IROW, ICOL, OMEGA, B, M, TOL, MAXITN, X, RNORM, ITN, WORK, LWORK, IWORK, IFAIL)
||N, NNZ, IROW(NNZ), ICOL(NNZ), M, MAXITN, ITN, LWORK, IWORK(2*N+1), IFAIL
||A(NNZ), OMEGA, B(N), TOL, X(N), RNORM, WORK(LWORK)
F11DEF solves a real sparse nonsymmetric system of linear equations
using an RGMRES (see Saad and Schultz (1986)
), CGS (see Sonneveld (1989)
) (see Van der Vorst (1989)
and Sleijpen and Fokkema (1993)
), or TFQMR (see Freund and Nachtigal (1991)
and Freund (1993)
The routine allows the following choices for the preconditioner:
- no preconditioning;
- Jacobi preconditioning (see Young (1971));
- symmetric successive-over-relaxation (SSOR) preconditioning (see Young (1971)).
(ILU) preconditioning see F11DCF
is represented in coordinate storage (CS) format (see Section 2.1.1
in the F11 Chapter Introduction) in the arrays A
. The array A
holds the nonzero entries in the matrix, while IROW
hold the corresponding row and column indices.
F11DEF is a Black Box routine which calls F11BDF
. If you wish to use an alternative storage scheme, preconditioner, or termination criterion, or require additional diagnostic information, you should call these underlying routines directly.
Freund R W (1993) A transpose-free quasi-minimal residual algorithm for non-Hermitian linear systems SIAM J. Sci. Comput. 14 470–482
Freund R W and Nachtigal N (1991) QMR: a Quasi-Minimal Residual Method for Non-Hermitian Linear Systems Numer. Math. 60 315–339
Saad Y and Schultz M (1986) GMRES: a generalized minimal residual algorithm for solving nonsymmetric linear systems SIAM J. Sci. Statist. Comput. 7 856–869
Sleijpen G L G and Fokkema D R (1993) BiCGSTAB for linear equations involving matrices with complex spectrum ETNA 1 11–32
Sonneveld P (1989) CGS, a fast Lanczos-type solver for nonsymmetric linear systems SIAM J. Sci. Statist. Comput. 10 36–52
Van der Vorst H (1989) Bi-CGSTAB, a fast and smoothly converging variant of Bi-CG for the solution of nonsymmetric linear systems SIAM J. Sci. Statist. Comput. 13 631–644
Young D (1971) Iterative Solution of Large Linear Systems Academic Press, New York
- 1: METHOD – CHARACTER(*)Input
: the iterative method to be used.
- Restarted generalized minimum residual method.
- Conjugate gradient squared method.
- Bi-conjugate gradient stabilized () method.
- Transpose-free quasi-minimal residual method.
, , or .
- 2: PRECON – CHARACTER(1)Input
: specifies the type of preconditioning to be used.
- No preconditioning.
- Symmetric successive-over-relaxation.
, or .
- 3: N – INTEGERInput
On entry: , the order of the matrix .
- 4: NNZ – INTEGERInput
On entry: the number of nonzero elements in the matrix .
- 5: A(NNZ) – REAL (KIND=nag_wp) arrayInput
: the nonzero elements of the matrix
, ordered by increasing row index, and by increasing column index within each row. Multiple entries for the same row and column indices are not permitted. The routine F11ZAF
may be used to order the elements in this way.
- 6: IROW(NNZ) – INTEGER arrayInput
- 7: ICOL(NNZ) – INTEGER arrayInput
: the row and column indices of the nonzero elements supplied in A
must satisfy the following constraints (which may be imposed by a call to F11ZAF
- and , for ;
- or and , for .
- 8: OMEGA – REAL (KIND=nag_wp)Input
is the relaxation parameter
to be used in the SSOR method. Otherwise OMEGA
need not be initialized and is not referenced.
- 9: B(N) – REAL (KIND=nag_wp) arrayInput
On entry: the right-hand side vector .
- 10: M – INTEGERInput
is the dimension of the restart subspace.
is the order
of the polynomial Bi-CGSTAB method.
is not referenced.
- if , ;
- if , .
- 11: TOL – REAL (KIND=nag_wp)Input
: the required tolerance. Let
denote the approximate solution at iteration
the corresponding residual. The algorithm is considered to have converged at iteration
is used, where
is the machine precision
- 12: MAXITN – INTEGERInput
On entry: the maximum number of iterations allowed.
- 13: X(N) – REAL (KIND=nag_wp) arrayInput/Output
On entry: an initial approximation to the solution vector .
On exit: an improved approximation to the solution vector .
- 14: RNORM – REAL (KIND=nag_wp)Output
: the final value of the residual norm
is the output value of ITN
- 15: ITN – INTEGEROutput
On exit: the number of iterations carried out.
- 16: WORK(LWORK) – REAL (KIND=nag_wp) arrayWorkspace
- 17: LWORK – INTEGERInput
: the dimension of the array WORK
as declared in the (sub)program from which F11DEF is called.
- if , ;
- if , ;
- if , ;
- if , .
where for or , and otherwise
- 18: IWORK() – INTEGER arrayWorkspace
- 19: IFAIL – INTEGERInput/Output
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.
unless the routine detects an error or a warning has been flagged (see Section 6
6 Error Indicators and Warnings
If on entry
, 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 'TFQMR',|
|or||, or ,|
|or|| and OMEGA lies outside the interval ,|
|or||, with ,|
|or||, with ,|
|or||LWORK too small.|
On entry, the arrays IROW
fail to satisfy the following constraints:
- and , for ;
- , or and , for .
Therefore a nonzero element has been supplied which does not lie within the matrix
, is out of order, or has duplicate row and column indices. Call F11ZAF
to reorder and sum or remove duplicates.
On entry, the matrix has a zero diagonal element. Jacobi and SSOR preconditioners are not appropriate for this problem.
The required accuracy could not be obtained. However, a reasonable accuracy may have been obtained, and further iterations could not improve the result. You should check the output value of RNORM
for acceptability. This error code usually implies that your problem has been fully and satisfactorily solved to within or close to the accuracy available on your system. Further iterations are unlikely to improve on this situation.
Required accuracy not obtained in MAXITN
Algorithmic breakdown. A solution is returned, although it is possible that it is completely inaccurate.
- (F11BDF, F11BEF or F11BFF)
A serious error has occurred in an internal call to one of the specified routines. Check all subroutine calls and array sizes. Seek expert help.
On successful termination, the final residual
, satisfies the termination criterion
The value of the final residual norm is returned in RNORM
The time taken by F11DEF for each iteration is roughly proportional to NNZ
The number of iterations required to achieve a prescribed accuracy cannot be easily determined a priori, as it can depend dramatically on the conditioning and spectrum of the preconditioned coefficient matrix .
This example solves a sparse nonsymmetric system of equations using the RGMRES method, with SSOR preconditioning.
9.1 Program Text
Program Text (f11defe.f90)
9.2 Program Data
Program Data (f11defe.d)
9.3 Program Results
Program Results (f11defe.r)