class HCL_PCG_d : public HCL_LinearSolver_d

HCL_PCG_d implements the preconditioned conjugate gradients algorithm for solving a linear operator equation with a symmetric positive definite operator

Inheritance:


Public Methods

HCL_PCG_d ( char *fname, HCL_LinearOp_d * m, HCL_LinearSolver_d * ls, HCL_Recorder_d * rec = NULL)
Constructor
HCL_PCG_d ( char *fname, HCL_LinearOp_d * minv, HCL_Recorder_d * rec = NULL )
Alternate 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
int MaxItn
Maximum number of iterations.
Default = 100
double Tol
Stopping criteria
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_PCG_d implements the preconditioned 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_PCG_d( char *fname, HCL_LinearOp_d * m, HCL_LinearSolver_d * ls, HCL_Recorder_d * rec = NULL)
Constructor. Takes (a pointer to) the preconditioner and (a pointer to) the linear solver (used for inverting the preconditioner), also (a pointer to) an optional Recorder object.
Parameters:
fname - Parameter file name, or NULL
m - Preconditioner
ls - Linear solver to invert preconditioner
rec - is an optional Recorder object

HCL_PCG_d( char *fname, HCL_LinearOp_d * minv, HCL_Recorder_d * rec = NULL )
Alternate constructor. Takes (a pointer to) the linear operator that computes the inverse of the preconditioner, also (a pointer to) an optional Recorder object.
Parameters:
fname - Parameter file name, or NULL
minv - Inverse of the preconditioner or NULL
rec - Optional 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 output 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::", "LinearSolverPCG::" or "PCG::"

int MaxItn
Maximum number of iterations.
Default = 100

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

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