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 )
Constructor
Table& Parameters ()
Access to parameter table
virtual int Solve ( const HCL_LinearOp_d & A, const HCL_Vector_d & b, HCL_Vector_d & x )
Solve (approximately) the equation Ax=b for x

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

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

Private Fields

int ReferenceCount

Documentation

HCL_CG_d implements the (unpreconditioned) conjugate gradients algorithm for solving a linear operator equation with a symmetric positive definite operator
HCL_CG_d( char *fname = NULL )
Constructor.
Parameters:
fname - Parameter file name, or NULL

Table& Parameters()
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 )
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

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 = 2

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