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

#include <ConjugateGradients.hpp>

Inheritance diagram for sgpp::solver::ConjugateGradients:
sgpp::solver::SLESolver sgpp::solver::SGSolver

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...
 
 ConjugateGradients (size_t imax, double 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...
 
virtual void solve (sgpp::base::OperationMatrix &SystemMatrix, sgpp::base::DataVector &alpha, sgpp::base::DataVector &b, bool reuse=false, bool verbose=false, double max_threshold=-1.0)
 Pure virtual 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 ~ConjugateGradients ()
 Std-Destructor. More...
 
- Public Member Functions inherited from sgpp::solver::SLESolver
 SLESolver (size_t imax, double epsilon)
 Std-Constructor. More...
 
virtual ~SLESolver ()
 Std-Destructor. More...
 
- Public Member Functions inherited from sgpp::solver::SGSolver
double 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...
 
double getResiduum ()
 function the returns the residuum (current or final), error of the solver More...
 
void setEpsilon (double eps)
 resets the epsilon, that is used in the SGSolver More...
 
void setMaxIterations (size_t nIterations)
 resets the number of maximum iterations More...
 
 SGSolver (size_t nMaximumIterations, double epsilon)
 Std-Constructor. More...
 
virtual ~SGSolver ()
 Std-Destructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from sgpp::solver::SGSolver
double 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...
 
double residuum
 residuum More...
 

Constructor & Destructor Documentation

◆ ConjugateGradients()

ConjugateGradients::ConjugateGradients ( size_t  imax,
double  epsilon 
)

Std-Constructor.

◆ ~ConjugateGradients()

ConjugateGradients::~ConjugateGradients ( )
virtual

Std-Destructor.

Member Function Documentation

◆ calcStarting()

void ConjugateGradients::calcStarting ( )
virtual

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

Referenced by solve().

◆ complete()

void ConjugateGradients::complete ( )
virtual

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

Referenced by solve().

◆ iterationComplete()

void ConjugateGradients::iterationComplete ( )
virtual

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

Referenced by solve().

◆ solve()

void ConjugateGradients::solve ( sgpp::base::OperationMatrix SystemMatrix,
sgpp::base::DataVector alpha,
sgpp::base::DataVector b,
bool  reuse = false,
bool  verbose = false,
double  max_threshold = -1.0 
)
virtual

Pure virtual Function that defines a solve method for an iterative solver.

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, default value is 10^-9!

Implements sgpp::solver::SLESolver.

References sgpp::base::DataVector::add(), sgpp::base::DataVector::axpy(), calcStarting(), complete(), sgpp::base::DataVector::dotProduct(), sgpp::base::DataVector::getSize(), iterationComplete(), sgpp::base::OperationMatrix::mult(), sgpp::base::DataVector::mult(), sgpp::solver::SGSolver::myEpsilon, sgpp::solver::SGSolver::nIterations, sgpp::solver::SGSolver::nMaxIterations, chess::r, sgpp::solver::SGSolver::residuum, sgpp::base::DataVector::setAll(), and starting().

Referenced by sgpp::datadriven::AlgorithmAdaBoostIdentity::alphaSolver(), main(), sgpp::pde::PoissonEquationSolver::solvePDE(), sgpp::pde::PoissonEquationSolver::storeInnerSolution(), sgpp::datadriven::LearnerSGDE::train(), sgpp::datadriven::SparseGridDensityEstimator::train(), sgpp::datadriven::LearnerSGDE::trainOnline(), and sgpp::datadriven::ModelFittingDensityEstimationCG::update().

◆ starting()

void ConjugateGradients::starting ( )
virtual

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

Referenced by solve().


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