SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
sgpp::base::WrapperScalarFunctionGradient Class Reference

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

#include <WrapperScalarFunctionGradient.hpp>

Inheritance diagram for sgpp::base::WrapperScalarFunctionGradient:
sgpp::base::ScalarFunctionGradient

Public Types

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

Public Member Functions

void clone (std::unique_ptr< ScalarFunctionGradient > &clone) const override
 
double eval (const DataVector &x, DataVector &gradient) override
 
 WrapperScalarFunctionGradient (size_t d, FunctionGradientEvalType fGradient)
 Constructor.
 
 ~WrapperScalarFunctionGradient () override
 Destructor.
 
- Public Member Functions inherited from sgpp::base::ScalarFunctionGradient
virtual void eval (const DataMatrix &x, DataVector &value, DataMatrix &gradient)
 Convenience method for calculating \(f(\vec{x})\) together with \(\nabla f(\vec{x})\) for multiple \(\vec{x}\).
 
size_t getNumberOfParameters () const
 
 ScalarFunctionGradient (size_t d)
 Constructor.
 
virtual ~ScalarFunctionGradient ()
 Destructor.
 

Protected Attributes

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

Detailed Description

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

Member Typedef Documentation

◆ FunctionGradientEvalType

Constructor & Destructor Documentation

◆ WrapperScalarFunctionGradient()

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

Constructor.

Parameters
ddimension of the domain
fGradientfunction gradient to be wrapped

◆ ~WrapperScalarFunctionGradient()

sgpp::base::WrapperScalarFunctionGradient::~WrapperScalarFunctionGradient ( )
inlineoverride

Destructor.

Member Function Documentation

◆ clone()

void sgpp::base::WrapperScalarFunctionGradient::clone ( std::unique_ptr< ScalarFunctionGradient > &  clone) const
inlineoverridevirtual
Parameters
[out]clonepointer to cloned object

Implements sgpp::base::ScalarFunctionGradient.

References clone(), sgpp::base::ScalarFunctionGradient::d, and fGradient.

Referenced by clone().

◆ eval()

double sgpp::base::WrapperScalarFunctionGradient::eval ( const DataVector x,
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::base::ScalarFunctionGradient.

References fGradient.

Referenced by python.uq.analysis.asgc.ASGCAnalysis.ASGCAnalysis::estimateDensity().

Member Data Documentation

◆ fGradient

FunctionGradientEvalType sgpp::base::WrapperScalarFunctionGradient::fGradient
protected

function gradient to be wrapped

Referenced by clone(), and eval().


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