SG++-Doxygen-Documentation
sgpp::optimization::WrapperScalarFunctionGradient Class Reference

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

#include <WrapperScalarFunctionGradient.hpp>

Inheritance diagram for sgpp::optimization::WrapperScalarFunctionGradient:
sgpp::optimization::ScalarFunctionGradient

Public Types

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

Public Member Functions

void clone (std::unique_ptr< ScalarFunctionGradient > &clone) const override
 
double eval (const base::DataVector &x, base::DataVector &gradient) override
 
 WrapperScalarFunctionGradient (size_t d, FunctionGradientEvalType fGradient)
 Constructor. More...
 
 ~WrapperScalarFunctionGradient () override
 Destructor. More...
 
- Public Member Functions inherited from sgpp::optimization::ScalarFunctionGradient
size_t getNumberOfParameters () const
 
 ScalarFunctionGradient (size_t d)
 Constructor. More...
 
virtual ~ScalarFunctionGradient ()
 Destructor. More...
 

Protected Attributes

FunctionGradientEvalType fGradient
 function gradient to be wrapped More...
 
- Protected Attributes inherited from sgpp::optimization::ScalarFunctionGradient
size_t d
 dimension of the domain More...
 

Detailed Description

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

Member Typedef Documentation

◆ FunctionGradientEvalType

Constructor & Destructor Documentation

◆ WrapperScalarFunctionGradient()

sgpp::optimization::WrapperScalarFunctionGradient::WrapperScalarFunctionGradient ( size_t  d,
FunctionGradientEvalType  fGradient 
)
inline

Constructor.

Parameters
ddimension of the domain
fGradientfunction gradient to be wrapped

Referenced by clone().

◆ ~WrapperScalarFunctionGradient()

sgpp::optimization::WrapperScalarFunctionGradient::~WrapperScalarFunctionGradient ( )
inlineoverride

Destructor.

Member Function Documentation

◆ clone()

void sgpp::optimization::WrapperScalarFunctionGradient::clone ( std::unique_ptr< ScalarFunctionGradient > &  clone) const
inlineoverridevirtual

◆ eval()

double sgpp::optimization::WrapperScalarFunctionGradient::eval ( const base::DataVector x,
base::DataVector gradient 
)
inlineoverridevirtual
Parameters
xevaluation point \(\vec{x} \in [0, 1]^d\)
[out]gradientgradient \(\nabla f(\vec{x}) \in \mathbb{R}^d\)
Returns
\(f(\vec{x})\)

Implements sgpp::optimization::ScalarFunctionGradient.

References fGradient.

Member Data Documentation

◆ fGradient

FunctionGradientEvalType sgpp::optimization::WrapperScalarFunctionGradient::fGradient
protected

function gradient to be wrapped

Referenced by clone(), and eval().


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