class HCL_CG_d : public HCL_LinearSolver_d

HCL_CG_d implements the (unpreconditioned) conjugate gradients algorithm for solving a linear operator equation with a symmetric positive definite operator

Inheritance:


Public Methods

HCL_CG_d ( char *fname = NULL, HCL_Recorder_d * rec = NULL)
Constructor
Table& Parameters () const
Access to parameter table
virtual int Solve ( const HCL_LinearOp_d & A, const HCL_Vector_d & b, HCL_Vector_d & x ) const
Solve (approximately) the equation Ax=b for x
virtual ostream& Write ( ostream & str ) const
Prints description of the object

Public

Input Parameters
double Tol
Stopping criteria
int MaxItn
Maximum number of iterations
int DispFlag
Display level
Output parameters
double ResidualNorm
Norm of the residual error
int TermCode
Termination code

Inherited from HCL_LinearSolver_d:


Inherited from HCL_Base:

Public Methods

void IncCount() const
void DecCount() const
int Count() const

Documentation

HCL_CG_d implements the (unpreconditioned) conjugate gradients algorithm for solving a linear operator equation with a symmetric positive definite operator. By passing an (optional pointer to an) HCL_Recorder_d object, the user can record all of the intermediate estimates of the solution generated during the iteration.
HCL_CG_d( char *fname = NULL, HCL_Recorder_d * rec = NULL)
Constructor.
Parameters:
fname - Parameter file name, or NULL
rec - Optional (pointer to) Recorder object

Table& Parameters() const
Access to parameter table. Algorithmic parameters can be accessed with Parameters().GetValue("NAME",val) or changed with Parameters().PutValue("NAME",val).

virtual int Solve( const HCL_LinearOp_d & A, const HCL_Vector_d & b, HCL_Vector_d & x ) const
Solve (approximately) the equation Ax=b for x
Returns:
The value of TermCode (see the Parameters section of this document.)
Parameters:
A - Linear operator
b - RHS vector
x - Initially, this must be a starting vector for the iteration. On exit, this contains the approximate solution

virtual ostream& Write( ostream & str ) const
Prints description of the object

Input Parameters
In a parameter file, the names may be prepended by "LinearSolver::", "LinearSolverCG::" or "CG::"

double Tol
Stopping criteria. The algorithm will terminate when the relative error is less than Tol. A value of 0.0 will imply a tolerance of 500*(machine epsilon).
Default = 1.0e-3

int MaxItn
Maximum number of iterations.
Default = 100

int DispFlag
Display level. This determines how much information should be displayed during the execution of the algorithm. Common values are:
0 - No output
1 - One-line summary output
2 - Detailed header and footer with timing information
3 - Per-iteration information

Default = 0

Output parameters

double ResidualNorm
Norm of the residual error

int TermCode
Termination code. Value is one of:

0 - Success
1 - Too many iterations taken


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de