SG++-Doxygen-Documentation
sgpp::combigrid::ArrayEvaluator< ScalarEvaluator > Class Template Reference

This class takes a 1D linear evaluator operating on scalars (which is given through the template type ScalarEvaluator) and uses multiple instances of it for doing multi-evaluation. More...

#include <ArrayEvaluator.hpp>

Inheritance diagram for sgpp::combigrid::ArrayEvaluator< ScalarEvaluator >:
sgpp::combigrid::AbstractLinearEvaluator< FloatArrayVector > sgpp::combigrid::AbstractEvaluator< FloatArrayVector >

Public Member Functions

 ArrayEvaluator (bool doesNeedParameter, ScalarEvaluator evaluatorPrototype=ScalarEvaluator())
 
 ArrayEvaluator (bool doesNeedParameter, ScalarEvaluator *evaluatorPrototype)
 
 ArrayEvaluator (ArrayEvaluator< ScalarEvaluator > const &other)
 
std::shared_ptr< AbstractLinearEvaluator< FloatArrayVector > > cloneLinear () override
 Clones this object and returns it as a shared pointer to AbstractLinearEvaluator<V>. More...
 
std::vector< double > getBasisCoefficients () override
 
std::vector< FloatArrayVectorgetBasisValues () override
 This method is specific to AbstractLinearEvaluator and has to be implemented by all subclasses. More...
 
bool needsOrderedPoints () override
 
bool needsParameter () override
 
void setBasisCoefficientsAtGridPoints (std::vector< double > &newBasisCoefficients) override
 set the basis coefficients for the linear combination. More...
 
void setGridPoints (std::vector< double > const &xValues) override
 Sets the grid points for evaluation. More...
 
void setParameter (FloatArrayVector const &param) override
 Via this method, the parameter can be set. More...
 
 ~ArrayEvaluator ()
 
- Public Member Functions inherited from sgpp::combigrid::AbstractLinearEvaluator< FloatArrayVector >
virtual std::shared_ptr< AbstractEvaluator< FloatArrayVector > > clone ()
 Clones the AbstractEvaluator object. More...
 
virtual FloatArrayVector eval ()
 AbstractLinearEvaluator provides a standard implementation of this method based on getBasisCoefficients(). More...
 
virtual void getBounds (double &a, double &b)
 
virtual void getWeightFunction (sgpp::combigrid::SingleFunction &weight_function)
 
virtual bool hasCustomWeightFunction ()
 
virtual void setBounds (double a, double b)
 
virtual void setWeightFunction (sgpp::combigrid::SingleFunction weight_function)
 
virtual ~AbstractLinearEvaluator ()
 
- Public Member Functions inherited from sgpp::combigrid::AbstractEvaluator< FloatArrayVector >
virtual EvaluatorConfiguration getConfig ()
 (Currently not used). More...
 
virtual void setConfig (EvaluatorConfiguration newEvalConfig)
 
void setLevel (size_t level)
 This is used to set the level in case an evaluator needs it. More...
 
virtual ~AbstractEvaluator ()
 

Additional Inherited Members

- Protected Attributes inherited from sgpp::combigrid::AbstractEvaluator< FloatArrayVector >
EvaluatorConfiguration evalConfig
 
size_t level
 

Detailed Description

template<typename ScalarEvaluator>
class sgpp::combigrid::ArrayEvaluator< ScalarEvaluator >

This class takes a 1D linear evaluator operating on scalars (which is given through the template type ScalarEvaluator) and uses multiple instances of it for doing multi-evaluation.

It is optimized to perform operations common to all of the evaluators only once.

Constructor & Destructor Documentation

◆ ArrayEvaluator() [1/3]

template<typename ScalarEvaluator>
sgpp::combigrid::ArrayEvaluator< ScalarEvaluator >::ArrayEvaluator ( bool  doesNeedParameter,
ScalarEvaluator  evaluatorPrototype = ScalarEvaluator() 
)
inlineexplicit

◆ ArrayEvaluator() [2/3]

template<typename ScalarEvaluator>
sgpp::combigrid::ArrayEvaluator< ScalarEvaluator >::ArrayEvaluator ( bool  doesNeedParameter,
ScalarEvaluator *  evaluatorPrototype 
)
inlineexplicit

◆ ArrayEvaluator() [3/3]

template<typename ScalarEvaluator>
sgpp::combigrid::ArrayEvaluator< ScalarEvaluator >::ArrayEvaluator ( ArrayEvaluator< ScalarEvaluator > const &  other)
inline

◆ ~ArrayEvaluator()

template<typename ScalarEvaluator>
sgpp::combigrid::ArrayEvaluator< ScalarEvaluator >::~ArrayEvaluator ( )
inline

Member Function Documentation

◆ cloneLinear()

template<typename ScalarEvaluator>
std::shared_ptr<AbstractLinearEvaluator<FloatArrayVector> > sgpp::combigrid::ArrayEvaluator< ScalarEvaluator >::cloneLinear ( )
inlineoverridevirtual

Clones this object and returns it as a shared pointer to AbstractLinearEvaluator<V>.

Implements sgpp::combigrid::AbstractLinearEvaluator< FloatArrayVector >.

◆ getBasisCoefficients()

template<typename ScalarEvaluator>
std::vector<double> sgpp::combigrid::ArrayEvaluator< ScalarEvaluator >::getBasisCoefficients ( )
inlineoverridevirtual

◆ getBasisValues()

template<typename ScalarEvaluator>
std::vector<FloatArrayVector> sgpp::combigrid::ArrayEvaluator< ScalarEvaluator >::getBasisValues ( )
inlineoverridevirtual

This method is specific to AbstractLinearEvaluator and has to be implemented by all subclasses.

It should return the coefficients used for the linear combination of function values. Example: If you want to do a linear interpolation and have the grid points 0.0 and 0.5 and an evaluation point (the parameter) of 0.2, you would return the weights (0.6, 0.4), because the interpolated value is 0.6 * f(0) + 0.4 * f(0.5).

In the case of multi-evaluation, this returns several coefficients for each grid point. Continuing the example above, if you would have evaluation points 0.2 and 0.4, the basis coefficients returned should be ((0.6, 0.2), (0.4, 0.8)).

Implements sgpp::combigrid::AbstractLinearEvaluator< FloatArrayVector >.

◆ needsOrderedPoints()

template<typename ScalarEvaluator>
bool sgpp::combigrid::ArrayEvaluator< ScalarEvaluator >::needsOrderedPoints ( )
inlineoverridevirtual
Returns
true iff the grid points have to be provided in ascending order (for example for linear interpolation).

Implements sgpp::combigrid::AbstractLinearEvaluator< FloatArrayVector >.

◆ needsParameter()

template<typename ScalarEvaluator>
bool sgpp::combigrid::ArrayEvaluator< ScalarEvaluator >::needsParameter ( )
inlineoverridevirtual
Returns
true iff this evaluation method needs a parameter (e.g. true for interpolation, false for quadrature).

Implements sgpp::combigrid::AbstractLinearEvaluator< FloatArrayVector >.

◆ setBasisCoefficientsAtGridPoints()

template<typename ScalarEvaluator>
void sgpp::combigrid::ArrayEvaluator< ScalarEvaluator >::setBasisCoefficientsAtGridPoints ( std::vector< double > &  newBasisCoefficients)
inlineoverridevirtual

set the basis coefficients for the linear combination.

In case of linear or polynomial interpolation these basis coefficients are function evaluations

Parameters
newBasisCoefficientsthe new coefficients

Implements sgpp::combigrid::AbstractLinearEvaluator< FloatArrayVector >.

◆ setGridPoints()

template<typename ScalarEvaluator>
void sgpp::combigrid::ArrayEvaluator< ScalarEvaluator >::setGridPoints ( std::vector< double > const &  xValues)
inlineoverridevirtual

Sets the grid points for evaluation.

The evaluation method should allow for arbitrary grid points to achieve maximal modularity.

Implements sgpp::combigrid::AbstractLinearEvaluator< FloatArrayVector >.

◆ setParameter()

template<typename ScalarEvaluator>
void sgpp::combigrid::ArrayEvaluator< ScalarEvaluator >::setParameter ( FloatArrayVector const &  param)
inlineoverridevirtual

Via this method, the parameter can be set.

Implements sgpp::combigrid::AbstractLinearEvaluator< FloatArrayVector >.


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