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

Abstract base class for scalar-valued functions \(f\colon [0, 1]^d \to \mathbb{R}\) together with their gradients \(\nabla f\colon [0, 1]^d \to \mathbb{R}^d\) (e.g., gradients of objective functions in optimization). More...

#include <ScalarFunctionGradient.hpp>

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

Public Member Functions

virtual void clone (std::unique_ptr< ScalarFunctionGradient > &clone) const =0
 Pure virtual method for cloning the gradient. More...
 
virtual double eval (const base::DataVector &x, base::DataVector &gradient)=0
 Pure virtual method for calculating \(f(\vec{x})\) together with \(\nabla f(\vec{x})\). More...
 
size_t getNumberOfParameters () const
 
 ScalarFunctionGradient (size_t d)
 Constructor. More...
 
virtual ~ScalarFunctionGradient ()
 Destructor. More...
 

Protected Attributes

size_t d
 dimension of the domain More...
 

Detailed Description

Abstract base class for scalar-valued functions \(f\colon [0, 1]^d \to \mathbb{R}\) together with their gradients \(\nabla f\colon [0, 1]^d \to \mathbb{R}^d\) (e.g., gradients of objective functions in optimization).

Constructor & Destructor Documentation

sgpp::optimization::ScalarFunctionGradient::ScalarFunctionGradient ( size_t  d)
inlineexplicit

Constructor.

Parameters
ddimension of the domain
virtual sgpp::optimization::ScalarFunctionGradient::~ScalarFunctionGradient ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual double sgpp::optimization::ScalarFunctionGradient::eval ( const base::DataVector x,
base::DataVector gradient 
)
pure virtual

Pure virtual method for calculating \(f(\vec{x})\) together with \(\nabla f(\vec{x})\).

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

Implemented in sgpp::optimization::ComponentScalarFunctionGradient, sgpp::optimization::InterpolantScalarFunctionGradient, and sgpp::optimization::WrapperScalarFunctionGradient.

Referenced by sgpp::optimization::ComponentScalarFunctionGradient::eval().

size_t sgpp::optimization::ScalarFunctionGradient::getNumberOfParameters ( ) const
inline
Returns
dimension \(d\) of the domain

References d.

Member Data Documentation

size_t sgpp::optimization::ScalarFunctionGradient::d
protected

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