naginterfaces.library.sparse.real_gen_solve_ilu¶
- naginterfaces.library.sparse.real_gen_solve_ilu(method, nnz, a, irow, icol, ipivp, ipivq, istr, idiag, b, m, tol, maxitn, x)[source]¶
real_gen_solve_ilu
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, with incomplete preconditioning.For full information please refer to the NAG Library document for f11dc
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/f11/f11dcf.html
- Parameters
- methodstr
Specifies 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.
- nnzint
The number of nonzero elements in the matrix . This must be the same value as was supplied in the preceding call to
real_gen_precon_ilu()
.- afloat, array-like, shape
The values returned in the array by a previous call to
real_gen_precon_ilu()
.- irowint, array-like, shape
The values returned in arrays , , , , and by a previous call to
real_gen_precon_ilu()
.and are restored on exit.
- icolint, array-like, shape
The values returned in arrays , , , , and by a previous call to
real_gen_precon_ilu()
.and are restored on exit.
- ipivpint, array-like, shape
The values returned in arrays , , , , and by a previous call to
real_gen_precon_ilu()
.and are restored on exit.
- ipivqint, array-like, shape
The values returned in arrays , , , , and by a previous call to
real_gen_precon_ilu()
.and are restored on exit.
- istrint, array-like, shape
The values returned in arrays , , , , and by a previous call to
real_gen_precon_ilu()
.and are restored on exit.
- idiagint, array-like, shape
The values returned in arrays , , , , and by a previous call to
real_gen_precon_ilu()
.and are restored on exit.
- bfloat, array-like, shape
The right-hand side vector .
- mint
If , is the dimension of the restart subspace.
If , is the order of the polynomial BI-CGSTAB method; otherwise, is not referenced.
- tolfloat
The required tolerance. Let denote the approximate solution at iteration , and the corresponding residual. The algorithm is considered to have converged at iteration if
If , is used, where is the machine precision. Otherwise is used.
- maxitnint
The maximum number of iterations allowed.
- xfloat, array-like, shape
An initial approximation to the solution vector .
- Returns
- xfloat, ndarray, shape
An improved approximation to the solution vector .
- rnormfloat
The final value of the residual norm , where is the output value of .
- itnint
The number of iterations carried out.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, and .
Constraint: and .
- (errno )
On entry, .
Constraint: , or .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, the location () is a duplicate: .
- (errno )
On entry, is out of order: .
- (errno )
On entry, , and .
Constraint: and .
- (errno )
On entry, , and .
Constraint: and .
- (errno )
The representation of the preconditioner is invalid.
- (errno )
Algorithmic breakdown. A solution is returned, although it is possible that it is completely inaccurate.
- (errno )
A serious error, code , has occurred in an internal call. Check all function calls and array sizes. Seek expert help.
- Warns
- NagAlgorithmicWarning
- (errno )
The required accuracy could not be obtained. However, a reasonable accuracy may have been achieved.
- (errno )
The solution has not converged after iterations.
- Notes
In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.
real_gen_solve_ilu
solves a real sparse nonsymmetric linear system of equations:using a preconditioned RGMRES (see Saad and Schultz (1986)), CGS (see Sonneveld (1989)), BI-CGSTAB() (see Van der Vorst (1989) and Sleijpen and Fokkema (1993)), or TFQMR (see Freund and Nachtigal (1991) and Freund (1993)) method.
real_gen_solve_ilu
uses the incomplete factorization determined byreal_gen_precon_ilu()
as the preconditioning matrix. A call toreal_gen_solve_ilu
must always be preceded by a call toreal_gen_precon_ilu()
. Alternative preconditioners for the same storage scheme are available by callingreal_gen_solve_jacssor()
.The matrix , and the preconditioning matrix , are represented in coordinate storage (CS) format (see the F11 Introduction) in the arrays , and , as returned from
real_gen_precon_ilu()
. The array holds the nonzero entries in these matrices, while and hold the corresponding row and column indices.real_gen_solve_ilu
is a Black Box function which callsreal_gen_basic_setup()
,real_gen_basic_solver()
andreal_gen_basic_diag()
. If you wish to use an alternative storage scheme, preconditioner, or termination criterion, or require additional diagnostic information, you should call these underlying functions directly.
- References
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
Salvini, S A and Shaw, G J, 1996, An evaluation of new NAG Library solvers for large sparse unsymmetric linear systems, NAG Technical Report TR2/96
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