SG++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sgpp::optimization::InterpolantScalarFunction Class Reference

Sparse grid interpolant of a scalar-valued function. More...

#include <InterpolantScalarFunction.hpp>

Inheritance diagram for sgpp::optimization::InterpolantScalarFunction:
sgpp::optimization::ScalarFunction

Public Member Functions

void clone (std::unique_ptr< ScalarFunction > &clone) const override
 
double eval (const base::DataVector &x) override
 Evaluation of the function. More...
 
const base::DataVectorgetAlpha () const
 
 InterpolantScalarFunction (base::Grid &grid, const base::DataVector &alpha)
 Constructor. More...
 
void setAlpha (const base::DataVector &alpha)
 
 ~InterpolantScalarFunction () override
 Destructor. More...
 
- Public Member Functions inherited from sgpp::optimization::ScalarFunction
size_t getNumberOfParameters () const
 
 ScalarFunction (size_t d)
 Constructor. More...
 
virtual ~ScalarFunction ()
 Destructor. More...
 

Protected Attributes

base::DataVector alpha
 coefficient vector More...
 
base::Gridgrid
 sparse grid More...
 
std::unique_ptr
< base::OperationEval
opEval
 pointer to evaluation operation More...
 
- Protected Attributes inherited from sgpp::optimization::ScalarFunction
size_t d
 dimension of the domain More...
 

Detailed Description

Sparse grid interpolant of a scalar-valued function.

More generally, the function can be any linear combination \(f\colon [0, 1]^d \to \mathbb{R}\), \(f(\vec{x}) = \sum_{k=1}^N \alpha_k \varphi_k(\vec{x})\) of the basis functions \(\varphi_k = \varphi_{\vec{\ell}_k,\vec{i}_k}\) of a sparse grid with grid points \(\vec{x}_k = \vec{x}_{\vec{\ell}_k,\vec{i}_k}\). But most often, the function (e.g., its coefficients) is constructed as an interpolant at the grid points for some function values.

Constructor & Destructor Documentation

sgpp::optimization::InterpolantScalarFunction::InterpolantScalarFunction ( base::Grid grid,
const base::DataVector alpha 
)
inline

Constructor.

Do not destruct the grid before the InterpolantScalarFunction object!

Parameters
gridsparse grid
alphacoefficient vector

Referenced by clone().

sgpp::optimization::InterpolantScalarFunction::~InterpolantScalarFunction ( )
inlineoverride

Destructor.

Member Function Documentation

void sgpp::optimization::InterpolantScalarFunction::clone ( std::unique_ptr< ScalarFunction > &  clone) const
inlineoverridevirtual
Parameters
[out]clonepointer to cloned object

Implements sgpp::optimization::ScalarFunction.

References alpha, grid, and InterpolantScalarFunction().

double sgpp::optimization::InterpolantScalarFunction::eval ( const base::DataVector x)
inlineoverridevirtual

Evaluation of the function.

Parameters
xevaluation point \(\vec{x} \in [0, 1]^d\)
Returns
\(f(\vec{x})\)

Implements sgpp::optimization::ScalarFunction.

References alpha, sgpp::optimization::ScalarFunction::d, and opEval.

const base::DataVector& sgpp::optimization::InterpolantScalarFunction::getAlpha ( ) const
inline
Returns
coefficient vector

References alpha.

void sgpp::optimization::InterpolantScalarFunction::setAlpha ( const base::DataVector alpha)
inline
Parameters
alphacoefficient vector

References alpha.

Member Data Documentation

base::DataVector sgpp::optimization::InterpolantScalarFunction::alpha
protected
std::unique_ptr<base::OperationEval> sgpp::optimization::InterpolantScalarFunction::opEval
protected

pointer to evaluation operation

Referenced by eval().


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