Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

ConjGrad Class Reference

iterative method for matrix systems. More...

#include <ConjGrad.h>

Inheritance diagram for ConjGrad::

KrylovItSolver IterativeSolver LinEqSolver HandleId List of all members.

Public Methods

 ConjGrad ()
 ConjGrad (const LinEqSolver_prm &pm)
 ~ConjGrad ()
virtual bool ok () const
virtual bool solve (LinEqSystem &system)
virtual String description () const

Protected Methods

virtual bool redim (LinEqSystem &system)
virtual void initCommBlk ()
virtual void updateCommBlk ()

Protected Attributes

NUMT alpha
NUMT beta
NUMT rho
NUMT rho1
LinEqVector u
LinEqVector p

Detailed Description

iterative method for matrix systems.

NAME: ConjGrad - iterative method for matrix systems

DESCRIPTION:

The class implements the conjugate gradient (CG) method for solving systems of linear equations. The system is represented as a class "LinEqSystem" object. Usually, an object of type "ConjGrad" is created on basis of the parameter object "LinEqSolver_prm" using the function "LinEqSolver_prm create".

To guarantee convergence of this method, the coefficient matrix should be symmetric and positive definite (SPD). Please notice that any preconditoner should also be SPD. In case of symmetric indefinite problems, a modified version is implemented in class "Symmlq".


Constructor & Destructor Documentation

ConjGrad::ConjGrad ( )
 

Since no parameters are needed for this methods, the default constructor takes no arguments. For the sake of compatibility, there is also a constructor accepting a "LinEqSolver_prm" object.

Internal "LinEqVector" attributes are not properly initialized by the constructor. These are initialized by the "redim" function which is called from "solve". Thus, the user of this class need not be careful with initialization of objects: The constructor and the "solve" function will take care of it.

ConjGrad::ConjGrad ( const LinEqSolver_prm & pm )
 

See documentation of one of the overloaded constructor.

ConjGrad::~ConjGrad ( ) [inline]
 


Member Function Documentation

String ConjGrad::description ( ) const [virtual]
 

Reimplemented from LinEqSolver.

void ConjGrad::initCommBlk ( ) [protected, virtual]
 

initializes the communication block needed for communication with attached "LinEqSystem", "EigenEstimator", "Precond" and "ConvMonitor" objects. This function is typically called by "init". (For internal use only).

Reimplemented from KrylovItSolver.

bool ConjGrad::ok ( ) const [virtual]
 

returns "true" if the object is in an ok state, that is, if all internal attricutes seems to be initialized. This "ok" function is called in "solve" and the user of the class should never need to call "ok".

Reimplemented from KrylovItSolver.

bool ConjGrad::redim ( LinEqSystem & system ) [protected, virtual]
 

redimensions the internal data structure (usually "LinEqVector" objects) on basis of the size of a "LinEqSystem" given as argument to "redim". The "redim" function is usually called from "solve" and a user of the class will seldom need to call "redim" explicitly.

Reimplemented from KrylovItSolver.

bool ConjGrad::solve ( LinEqSystem & system ) [virtual]
 

solve a system of linear equations.

Reimplemented from KrylovItSolver.

void ConjGrad::updateCommBlk ( ) [protected, virtual]
 

forces a update of the attached communication block, should be called at the end of each iteration. (For internal use only).

Reimplemented from IterativeSolver.


Member Data Documentation

NUMT ConjGrad::alpha [protected]
 

NUMT ConjGrad::beta [protected]
 

LinEqVector ConjGrad::p [protected]
 

NUMT ConjGrad::rho [protected]
 

NUMT ConjGrad::rho1 [protected]
 

LinEqVector ConjGrad::u [protected]
 


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.