|
TBCI Numerical high perf. C++ Library
2.8.0
|
The iterative Vector equation solver TBCI::CGS. More...
#include "tbci/basics.h"
Go to the source code of this file.
Functions | |
| NAMESPACE_TBCI | INST3 (template< typename T, Matrix< T >, Vector< T > > class NN friend int CGS(const Matrix< T > &, Vector< T > &, const Vector< T > &, const Preconditioner_Sig< T, Matrix< T > > &, unsigned int &, double &, const unsigned);) INST3(template< typename T |
| Iterative template routine – CGS. More... | |
| NAMESPACE_TBCI Vector< T > class NN friend int | CGS (const BdMatrix< T > &, Vector< T > &, const Vector< T > &, const Preconditioner_Sig< T, BdMatrix< T > > &, unsigned int &, double &, const unsigned) |
| INST3 (template< typename T, Symm_BdMatrix< T >, Vector< T > > class NN friend int CGS(const Symm_BdMatrix< T > &, Vector< T > &, const Vector< T > &, const Preconditioner_Sig< T, Symm_BdMatrix< T > > &, unsigned int &, double &, const unsigned);) template< typename T | |
| SysVector int | CGS (const SysMatrix &A, SysVector &x, const SysVector &b, const Preconditioner_Sig< T, SysMatrix > &M, unsigned int &max_iter, double &tol, const unsigned off=0) |
Variables | |
| NAMESPACE_TBCI | BdMatrix< T > |
| SysMatrix | |
| NAMESPACE_TBCI Vector<T> class NN friend int CGS | ( | const BdMatrix< T > & | , |
| Vector< T > & | , | ||
| const Vector< T > & | , | ||
| const Preconditioner_Sig< T, BdMatrix< T > > & | , | ||
| unsigned int & | , | ||
| double & | , | ||
| const unsigned | |||
| ) |
| SysVector int CGS | ( | const SysMatrix & | A, |
| SysVector & | x, | ||
| const SysVector & | b, | ||
| const Preconditioner_Sig< T, SysMatrix > & | M, | ||
| unsigned int & | max_iter, | ||
| double & | tol, | ||
| const unsigned | off = 0 |
||
| ) |
Definition at line 70 of file cgs.h.
References BVector< T >::dim, TBCI::dot(), i, MATH__, p, Preconditioner_Sig< T, MatrixType >::solve(), sqr(), std::sqrt(), STD__, and TBCI__.
| NAMESPACE_TBCI INST3 | ( | template< typename T, Matrix< T >, Vector< T > > class NN friend int CGS(const Matrix< T > &, Vector< T > &, const Vector< T > &, const Preconditioner_Sig< T, Matrix< T > > &, unsigned int &, double &, const unsigned); | ) |
Iterative template routine – CGS.
CGS solves the unsymmetric linear system Ax = b using the Conjugate Gradient Squared method
CGS follows the algorithm described on p. 26 of the SIAM Templates book.
Arguments:
| A | – System Matrix, contains the coeffs of the linear system |
| x | – input: initial guess value for solution; output: approximate solution to Ax = b |
| b | – Vector (inhomogeneity) |
| M | – Preconditioner |
| max_iter | – input: max number of iterations allowed; output: the number of iterations performed before the tolerance was reached |
| tol | – input: desired residual (measurement for relative error); output: the residual after the final iteration |
| off | – Only used for solver logging: offset counter |
If you use a preconditioner, don't forget to initialize it with the sys matrix (via constructor or update() member fct.)
| INST3 | ( | template< typename T, Symm_BdMatrix< T >, Vector< T > > class NN friend int CGS(const Symm_BdMatrix< T > &, Vector< T > &, const Vector< T > &, const Preconditioner_Sig< T, Symm_BdMatrix< T > > &, unsigned int &, double &, const unsigned); | ) |
1.8.5