NUMCXX
0.13.20181108
Numerical library for small projects and teaching purposes
|
Iterative template routines.
Original version of template routines from netlib as of 2016-11-08 (file dates: 1998-07-21), slightly modified for numcxx (see corresponding comments).
Functions | |
template<class Matrix , class Vector , class Preconditioner , class Real > | |
int | BiCGSTAB (const Matrix &A, Vector &x, const Vector &b, const Preconditioner &M, int &max_iter, Real &tol) |
Iterative template routine – BiCGSTAB. More... | |
template<class Matrix , class Vector , class Preconditioner , class Real > | |
int | CG (const Matrix &A, Vector &x, const Vector &b, const Preconditioner &M, int &max_iter, Real &tol) |
Iterative template routine – CG. More... | |
int netlib::BiCGSTAB | ( | const Matrix & | A, |
Vector & | x, | ||
const Vector & | b, | ||
const Preconditioner & | M, | ||
int & | max_iter, | ||
Real & | tol | ||
) |
Iterative template routine – BiCGSTAB.
Original version from netlib as of 2016-11-08 (file date: 1998-07-21), slightly modified for numcxx (see corresponding comment).
BiCGSTAB solves the unsymmetric linear system Ax = b using the Preconditioned BiConjugate Gradient Stabilized method
BiCGSTAB follows the algorithm described on p. 27 of the (SIAM Templates book)[http://www.netlib.org/templates/templates.pdf].
The return value indicates convergence within max_iter (input) iterations (0), or no convergence within max_iter iterations (1).
Upon successful return, output arguments have the following values:
x | – approximate solution to Ax = b |
max_iter | – the number of iterations performed before the tolerance was reached |
tol | – the residual after the final iteration |
Definition at line 29 of file bicgstab.hxx.
int netlib::CG | ( | const Matrix & | A, |
Vector & | x, | ||
const Vector & | b, | ||
const Preconditioner & | M, | ||
int & | max_iter, | ||
Real & | tol | ||
) |
Iterative template routine – CG.
Original version from netlib as of 2016-11-08 (file date: 1998-07-21), slightly modified for numcxx (see corresponding comment).
CG solves the symmetric positive definite linear system Ax=b using the Conjugate Gradient method.
CG follows the algorithm described on p. 15 in the (SIAM Templates book)[http://www.netlib.org/templates/templates.pdf].
The return value indicates convergence within max_iter (input) iterations (0), or no convergence within max_iter iterations (1).
Upon successful return, output arguments have the following values:
x | – approximate solution to Ax = b |
max_iter | – the number of iterations performed before the tolerance was reached |
tol | – the residual after the final iteration |
Definition at line 28 of file cg.hxx.