CUDA Lab Course Reference Manual 2011

SolverCG< VECTOR > Class Template Reference

Inheritance diagram for SolverCG< VECTOR >:

Solver< VECTOR > Subscriptor

List of all members.


Classes

struct  AdditionalData

Public Member Functions

 SolverCG (::SolverControl &cn,::VectorMemory< VECTOR > &mem, const AdditionalData &data=AdditionalData())
 SolverCG (::SolverControl &cn, const AdditionalData &data=AdditionalData())
virtual ~SolverCG ()
template<class MATRIX , class PRECONDITIONER >
void solve (const MATRIX &A, VECTOR &x, const VECTOR &b, const PRECONDITIONER &precondition)

Protected Member Functions

virtual double criterion ()
virtual void print_vectors (const unsigned int step, const VECTOR &x, const VECTOR &r, const VECTOR &d) const

Protected Attributes

VECTOR * Vr
VECTOR * Vp
VECTOR * Vz
VECTOR * VAp
double res2
AdditionalData additional_data

Private Member Functions

void cleanup ()

template<class VECTOR = ::Vector<double>>
class SolverCG< VECTOR >


Constructor & Destructor Documentation

template<class VECTOR >
SolverCG< VECTOR >::SolverCG ( ::SolverControl &  cn,
::VectorMemory< VECTOR > &  mem,
const AdditionalData data = AdditionalData() 
) [inline]

Constructor.

template<class VECTOR >
SolverCG< VECTOR >::SolverCG ( ::SolverControl &  cn,
const AdditionalData data = AdditionalData() 
) [inline]

Constructor. Use an object of type GrowingVectorMemory as a default to allocate memory.

template<class VECTOR >
SolverCG< VECTOR >::~SolverCG (  )  [inline, virtual]

Virtual destructor.


Member Function Documentation

template<class VECTOR >
template<class MATRIX , class PRECONDITIONER >
void SolverCG< VECTOR >::solve ( const MATRIX &  A,
VECTOR &  x,
const VECTOR &  b,
const PRECONDITIONER &  precondition 
) [inline]

template<class VECTOR >
double SolverCG< VECTOR >::criterion (  )  [inline, protected, virtual]

Implementation of the computation of the norm of the residual. This can be replaced by a more problem oriented functional in a derived class.

References SolverCG< VECTOR >::res2.

template<class VECTOR >
void SolverCG< VECTOR >::print_vectors ( const unsigned int  step,
const VECTOR &  x,
const VECTOR &  r,
const VECTOR &  d 
) const [inline, protected, virtual]

Interface for derived class. This function gets the current iteration vector, the residual and the update vector in each step. It can be used for a graphical output of the convergence history.

Referenced by SolverCG< VECTOR >::solve().

template<class VECTOR >
void SolverCG< VECTOR >::cleanup (  )  [inline, private]


Member Data Documentation

template<class VECTOR = ::Vector<double>>
VECTOR* SolverCG< VECTOR >::Vr [protected]

Temporary vectors, allocated through the VectorMemory object at the start of the actual solution process and deallocated at the end.

Referenced by SolverCG< VECTOR >::cleanup(), and SolverCG< VECTOR >::solve().

template<class VECTOR = ::Vector<double>>
VECTOR* SolverCG< VECTOR >::Vp [protected]

template<class VECTOR = ::Vector<double>>
VECTOR* SolverCG< VECTOR >::Vz [protected]

template<class VECTOR = ::Vector<double>>
VECTOR* SolverCG< VECTOR >::VAp [protected]

template<class VECTOR = ::Vector<double>>
double SolverCG< VECTOR >::res2 [protected]

Within the iteration loop, the square of the residual vector is stored in this variable. The function criterion uses this variable to compute the convergence value, which in this class is the norm of the residual vector and thus the square root of the res2 value.

Referenced by SolverCG< VECTOR >::criterion().

template<class VECTOR = ::Vector<double>>
AdditionalData SolverCG< VECTOR >::additional_data [protected]

Additional parameters.

Referenced by SolverCG< VECTOR >::solve().


The documentation for this class was generated from the following file:

blanc++ documentation generated on Mon Jul 18 12:05:12 2011 by doxygen 1.5.7