TBCI Numerical high perf. C++ Library  2.8.0
Functions | Variables
cgs.h File Reference

The iterative Vector equation solver TBCI::CGS. More...

#include "tbci/basics.h"
Include dependency graph for cgs.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
 

Detailed Description

The iterative Vector equation solver TBCI::CGS.

Definition in file cgs.h.

Function Documentation

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 
)
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.

Returns
The return value indicates convergence within max_iter (input) iterations (0), or no convergence within max_iter iterations (1). If the solver breaks down prematurely, it will return a value > 1.

Arguments:

Parameters
A– System Matrix, contains the coeffs of the linear system
x– input: initial guess value for solution; output: approximate solution to Ax = b
bVector (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);  )

Variable Documentation

Definition at line 61 of file cgs.h.

SysMatrix

Definition at line 69 of file cgs.h.