SG++-Doxygen-Documentation
sgpp::combigrid::LinearInterpolationEvaluator Class Reference

This evaluator does linear interpolation on the given grid points. More...

#include <LinearInterpolationEvaluator.hpp>

Inheritance diagram for sgpp::combigrid::LinearInterpolationEvaluator:
sgpp::combigrid::AbstractLinearEvaluator< FloatScalarVector > sgpp::combigrid::AbstractEvaluator< FloatScalarVector >

Public Member Functions

std::shared_ptr< AbstractLinearEvaluator< FloatScalarVector > > cloneLinear () override
 Clones this object and returns it as a shared pointer to AbstractLinearEvaluator<V>. More...
 
virtual std::vector< double > getBasisCoefficients ()
 
virtual std::vector< FloatScalarVectorgetBasisValues ()
 This method is specific to AbstractLinearEvaluator and has to be implemented by all subclasses. More...
 
 LinearInterpolationEvaluator ()
 
 LinearInterpolationEvaluator (LinearInterpolationEvaluator const &other)
 
bool needsOrderedPoints () override
 
bool needsParameter () override
 
void setBasisCoefficientsAtGridPoints (std::vector< double > &functionValues) override
 set the basis coefficients for the linear combination. More...
 
void setGridPoints (std::vector< double > const &newXValues) override
 Sets the grid points for evaluation. More...
 
void setParameter (FloatScalarVector const &param) override
 Via this method, the parameter can be set. More...
 
virtual ~LinearInterpolationEvaluator ()
 
- Public Member Functions inherited from sgpp::combigrid::AbstractLinearEvaluator< FloatScalarVector >
virtual std::shared_ptr< AbstractEvaluator< FloatScalarVector > > clone ()
 Clones the AbstractEvaluator object. More...
 
virtual FloatScalarVector 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< FloatScalarVector >
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< FloatScalarVector >
EvaluatorConfiguration evalConfig
 
size_t level
 

Detailed Description

This evaluator does linear interpolation on the given grid points.

If the evaluation point is outside the grid points, it will just use the function value of the nearest grid point.

Constructor & Destructor Documentation

◆ LinearInterpolationEvaluator() [1/2]

sgpp::combigrid::LinearInterpolationEvaluator::LinearInterpolationEvaluator ( )

◆ ~LinearInterpolationEvaluator()

sgpp::combigrid::LinearInterpolationEvaluator::~LinearInterpolationEvaluator ( )
virtual

◆ LinearInterpolationEvaluator() [2/2]

Member Function Documentation

◆ cloneLinear()

std::shared_ptr< AbstractLinearEvaluator< FloatScalarVector > > sgpp::combigrid::LinearInterpolationEvaluator::cloneLinear ( )
overridevirtual

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

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

References LinearInterpolationEvaluator().

Referenced by getBasisCoefficients().

◆ getBasisCoefficients()

virtual std::vector<double> sgpp::combigrid::LinearInterpolationEvaluator::getBasisCoefficients ( )
inlinevirtual

◆ getBasisValues()

virtual std::vector<FloatScalarVector> sgpp::combigrid::LinearInterpolationEvaluator::getBasisValues ( )
inlinevirtual

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< FloatScalarVector >.

◆ needsOrderedPoints()

bool sgpp::combigrid::LinearInterpolationEvaluator::needsOrderedPoints ( )
overridevirtual
Returns
true iff the grid points have to be provided in ascending order (for example for linear interpolation).

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

Referenced by getBasisCoefficients().

◆ needsParameter()

bool sgpp::combigrid::LinearInterpolationEvaluator::needsParameter ( )
overridevirtual
Returns
true iff this evaluation method needs a parameter (e.g. true for interpolation, false for quadrature).

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

Referenced by getBasisCoefficients().

◆ setBasisCoefficientsAtGridPoints()

void sgpp::combigrid::LinearInterpolationEvaluator::setBasisCoefficientsAtGridPoints ( std::vector< double > &  newBasisCoefficients)
overridevirtual

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< FloatScalarVector >.

Referenced by getBasisCoefficients().

◆ setGridPoints()

void sgpp::combigrid::LinearInterpolationEvaluator::setGridPoints ( std::vector< double > const &  xValues)
overridevirtual

Sets the grid points for evaluation.

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

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

Referenced by getBasisCoefficients().

◆ setParameter()

void sgpp::combigrid::LinearInterpolationEvaluator::setParameter ( FloatScalarVector const &  param)
overridevirtual

Via this method, the parameter can be set.

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

References sgpp::combigrid::FloatScalarVector::value().

Referenced by getBasisCoefficients().


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