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 * minv )
Alternate constructor
HCL_PCG_d ( char *fname, HCL_LinearOp_d * m, HCL_LinearSolver_d * ls )
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
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

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

Private Fields

int ReferenceCount

Documentation

HCL_PCG_d implements the preconditioned conjugate gradients algorithm for solving a linear operator equation with a symmetric positive definite operator
HCL_PCG_d( char *fname, HCL_LinearOp_d * m, HCL_LinearSolver_d * ls )
Constructor. Takes (a pointer to) the preconditioner and (a pointer to) the linear solver (used for inverting the preconditioner).
Parameters:
fname - Parameter file name, or NULL
m - Preconditioner
ls - Linear solver to invert preconditioner

HCL_PCG_d( char *fname, HCL_LinearOp_d * minv )
Alternate constructor. Takes (a pointer to) the linear operator that computes the inverse of the preconditioner
Parameters:
fname - Parameter file name, or NULL
minv - Inverse of the preconditioner 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 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

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