HLIBpro  2.1
Classes | Public Member Functions | Protected Attributes | List of all members
TSolver Class Reference

Solver base class defining interface and implementing simple solver (Richardson iteration)

#include <TSolver.hh>

Inheritance diagram for TSolver:
TAutoSolver TBiCGStab TCG TGMRES TMINRES

Classes

struct  TInfo
 datatype to share iteration history More...
 

Public Member Functions

 TSolver (const uint max_iter=100, const real abs_res_red=real(1e-8), const real rel_res_red=real(1e-8), const real rel_res_growth=real(1e6))
 construct Richardson solver object with corresponding stop criteria
 
virtual ~TSolver ()
 dtor
 
virtual void solve (const TLinearOperator *A, TVector *x, const TVector *b, const TLinearOperator *W=NULL, TInfo *data=NULL) const
 solve A·x = b with optional preconditioner W
 
virtual void set_stop_crit (const uint max_iter=100, const real abs_res_red=real(1e-8), const real rel_res_red=real(1e-8), const real rel_res_growth=real(1e6))
 set stop criterion
 
virtual bool stop (const uint it, const real norm, const real norm0, TInfo *info) const
 return true if stop condition is met
 

Protected Attributes

uint _max_iter
 maximal number of iterations
 
real _abs_res_reduct
 absolute reduction of residual norm
 
real _rel_res_reduct
 relative reduction of residual norm compared to start residual
 
real _rel_res_growth
 maximal relative growth of residual norm compared to start residual