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

Implementation of ScalarFunction that wraps a std::function object. More...

#include <WrapperScalarFunction.hpp>

Inheritance diagram for sgpp::optimization::WrapperScalarFunction:
sgpp::optimization::ScalarFunction

Public Types

typedef std::function< double(const
base::DataVector &)> 
FunctionEvalType
 

Public Member Functions

void clone (std::unique_ptr< ScalarFunction > &clone) const override
 
double eval (const base::DataVector &x) override
 
 WrapperScalarFunction (size_t d, FunctionEvalType f)
 Constructor. More...
 
 ~WrapperScalarFunction () 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

FunctionEvalType f
 function to be wrapped More...
 
- Protected Attributes inherited from sgpp::optimization::ScalarFunction
size_t d
 dimension of the domain More...
 

Detailed Description

Implementation of ScalarFunction that wraps a std::function object.

Member Typedef Documentation

Constructor & Destructor Documentation

sgpp::optimization::WrapperScalarFunction::WrapperScalarFunction ( size_t  d,
FunctionEvalType  f 
)
inline

Constructor.

Parameters
ddimension of the domain
ffunction to be wrapped

Referenced by clone().

sgpp::optimization::WrapperScalarFunction::~WrapperScalarFunction ( )
inlineoverride

Destructor.

Member Function Documentation

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

Implements sgpp::optimization::ScalarFunction.

References sgpp::optimization::ScalarFunction::d, f, and WrapperScalarFunction().

double sgpp::optimization::WrapperScalarFunction::eval ( const base::DataVector x)
inlineoverridevirtual
Parameters
xevaluation point \(\vec{x} \in [0, 1]^d\)
Returns
\(f(\vec{x})\)

Implements sgpp::optimization::ScalarFunction.

References f.

Member Data Documentation

FunctionEvalType sgpp::optimization::WrapperScalarFunction::f
protected

function to be wrapped

Referenced by clone(), and eval().


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