SG++-Doxygen-Documentation
sgpp::solver::ConjugateGradientsSP Class Reference

#include <ConjugateGradientsSP.hpp>

Inheritance diagram for sgpp::solver::ConjugateGradientsSP:
sgpp::solver::SLESolverSP sgpp::solver::SGSolverSP

Public Member Functions

virtual void calcStarting ()
 function that signals the start of the calculation of the CG method (used in python) More...
 
virtual void complete ()
 function that signals the finish of the cg method (used in python) More...
 
 ConjugateGradientsSP (size_t imax, float epsilon)
 Std-Constructor. More...
 
virtual void iterationComplete ()
 function that signals that one iteration step of the CG method has been completed (used in python) More...
 
void solve (sgpp::base::OperationMatrixSP &SystemMatrix, sgpp::base::DataVectorSP &alpha, sgpp::base::DataVectorSP &b, bool reuse=false, bool verbose=false, float max_threshold=-1.0)
 function that defines a solve method for an iterative solver. More...
 
virtual void starting ()
 function that signals the start of the CG method (used in python) More...
 
virtual ~ConjugateGradientsSP ()
 Std-Destructor. More...
 
- Public Member Functions inherited from sgpp::solver::SLESolverSP
 SLESolverSP (size_t imax, float epsilon)
 Std-Constructor. More...
 
virtual ~SLESolverSP ()
 Std-Destructor. More...
 
- Public Member Functions inherited from sgpp::solver::SGSolverSP
float getEpsilon ()
 gets the the epsilon, that is used in the SGSolver More...
 
size_t getNumberIterations ()
 function that returns the number of needed solve steps More...
 
float getResiduum ()
 function the returns the residuum (current or final), error of the solver More...
 
void setEpsilon (float eps)
 resets the epsilon, that is used in the SGSolver More...
 
void setMaxIterations (size_t nIterations)
 resets the number of maximum iterations More...
 
 SGSolverSP (size_t nMaximumIterations, float epsilon)
 Std-Constructor. More...
 
virtual ~SGSolverSP ()
 Std-Destructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from sgpp::solver::SGSolverSP
float myEpsilon
 epsilon needed in the, e.g. final error in the iterative solver, or a timestep More...
 
size_t nIterations
 Number of Iterations needed for the solve. More...
 
size_t nMaxIterations
 Number of maximum iterations for cg. More...
 
float residuum
 residuum More...
 

Constructor & Destructor Documentation

◆ ConjugateGradientsSP()

sgpp::solver::ConjugateGradientsSP::ConjugateGradientsSP ( size_t  imax,
float  epsilon 
)

Std-Constructor.

◆ ~ConjugateGradientsSP()

sgpp::solver::ConjugateGradientsSP::~ConjugateGradientsSP ( )
virtual

Std-Destructor.

Member Function Documentation

◆ calcStarting()

void sgpp::solver::ConjugateGradientsSP::calcStarting ( )
virtual

function that signals the start of the calculation of the CG method (used in python)

◆ complete()

void sgpp::solver::ConjugateGradientsSP::complete ( )
virtual

function that signals the finish of the cg method (used in python)

◆ iterationComplete()

void sgpp::solver::ConjugateGradientsSP::iterationComplete ( )
virtual

function that signals that one iteration step of the CG method has been completed (used in python)

◆ solve()

void sgpp::solver::ConjugateGradientsSP::solve ( sgpp::base::OperationMatrixSP SystemMatrix,
sgpp::base::DataVectorSP alpha,
sgpp::base::DataVectorSP b,
bool  reuse = false,
bool  verbose = false,
float  max_threshold = -1.0 
)
virtual

function that defines a solve method for an iterative solver.

In contrast to the normal solve routine this method operates on sinlge precision data.

Parameters
SystemMatrixreference to an sgpp::base::OperationMatrix Object that implements the matrix vector multiplication
alphathe sparse grid's coefficients which have to be determined
bthe right hand side of the system of linear equations
reuseidentifies if the alphas, stored in alpha at calling time, should be reused
verboseprints information during execution of the solver
max_thresholdadditional abort criteria for solver

Implements sgpp::solver::SLESolverSP.

References sgpp::base::DataVectorSP::add(), sgpp::base::DataVectorSP::axpy(), sgpp::base::DataVectorSP::dotProduct(), python.statsfileInfo::f, sgpp::base::DataVectorSP::getSize(), sgpp::base::OperationMatrixSP::mult(), sgpp::base::DataVectorSP::mult(), sgpp::solver::SGSolverSP::myEpsilon, sgpp::solver::SGSolverSP::nIterations, sgpp::solver::SGSolverSP::nMaxIterations, chess::r, sgpp::solver::SGSolverSP::residuum, and sgpp::base::DataVectorSP::setAll().

◆ starting()

void sgpp::solver::ConjugateGradientsSP::starting ( )
virtual

function that signals the start of the CG method (used in python)


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