![]() |
SG++-Doxygen-Documentation
|
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>
Public Member Functions | |
virtual void | clone (std::unique_ptr< ScalarFunctionGradient > &clone) const =0 |
Pure virtual method for cloning the gradient. | |
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}\). | |
virtual double | eval (const DataVector &x, DataVector &gradient)=0 |
Pure virtual method for calculating \(f(\vec{x})\) together with \(\nabla f(\vec{x})\). | |
size_t | getNumberOfParameters () const |
ScalarFunctionGradient (size_t d) | |
Constructor. | |
virtual | ~ScalarFunctionGradient () |
Destructor. | |
Protected Attributes | |
size_t | d |
dimension of the domain | |
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).
|
inlineexplicit |
Constructor.
d | dimension of the domain |
|
inlinevirtual |
Destructor.
|
pure virtual |
Pure virtual method for cloning the gradient.
It should generate a pointer to the cloned object and it's used for parallel computations (the eval() method might not be thread-safe).
[out] | clone | pointer to cloned object |
Implemented in sgpp::base::ComponentScalarFunctionGradient, sgpp::base::InterpolantScalarFunctionGradient, sgpp::base::ScaledScalarFunctionGradient, and sgpp::base::WrapperScalarFunctionGradient.
|
inlinevirtual |
Convenience method for calculating \(f(\vec{x})\) together with \(\nabla f(\vec{x})\) for multiple \(\vec{x}\).
x | matrix \(\vec{x} \in [0, 1]^{N \times d}\) of evaluation points (row-wise) | |
[out] | value | vector of size \(N\), where the \(k\)-th entry is \(f(\vec{x}_k)\) (where \(\vec{x}_k\) is the \(k\)-th row of \(x\)) |
[out] | gradient | matrix of size \(N \times d\) where the \(k\)-th row is \(\nabla f(\vec{x}_k)\) |
References d, eval(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getRow(), sgpp::base::DataMatrix::resize(), and sgpp::base::DataMatrix::setRow().
Referenced by python.uq.analysis.asgc.ASGCAnalysis.ASGCAnalysis::estimateDensity().
|
pure virtual |
Pure virtual method for calculating \(f(\vec{x})\) together with \(\nabla f(\vec{x})\).
x | evaluation point \(\vec{x} \in [0, 1]^d\) | |
[out] | gradient | gradient \(\nabla f(\vec{x}) \in \mathbb{R}^d\) |
Implemented in sgpp::optimization::ASInterpolantScalarFunctionGradient, sgpp::base::ComponentScalarFunctionGradient, sgpp::base::InterpolantScalarFunctionGradient, sgpp::base::ScaledScalarFunctionGradient, and sgpp::base::WrapperScalarFunctionGradient.
Referenced by python.uq.analysis.asgc.ASGCAnalysis.ASGCAnalysis::estimateDensity(), eval(), and sgpp::base::ComponentScalarFunctionGradient::eval().
|
inline |
References d.
|
protected |
dimension of the domain
Referenced by sgpp::base::WrapperScalarFunctionGradient::clone(), eval(), sgpp::base::InterpolantScalarFunctionGradient::eval(), sgpp::base::ScaledScalarFunctionGradient::eval(), and getNumberOfParameters().