SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
sgpp::base::ScalarFunctionHessian 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\) and Hessians \(H_f\colon [0, 1]^d \to \mathbb{R}^{d \times d}\) (e.g., Hessians of objective functions in optimization). More...

#include <ScalarFunctionHessian.hpp>

Inheritance diagram for sgpp::base::ScalarFunctionHessian:
sgpp::base::ComponentScalarFunctionHessian sgpp::base::InterpolantScalarFunctionHessian sgpp::base::ScaledScalarFunctionHessian sgpp::base::WrapperScalarFunctionHessian

Public Member Functions

virtual void clone (std::unique_ptr< ScalarFunctionHessian > &clone) const =0
 Pure virtual method for cloning the Hessian.
 
void eval (const DataMatrix &x, DataVector &value, DataMatrix &gradient, std::vector< DataMatrix > &hessian)
 Convenience method for calculating \(f(\vec{x})\) together with \(\nabla f(\vec{x})\) and \(H_f(\vec{x}) \in \mathbb{R}^{d \times d}\) for multiple \(\vec{x}\).
 
virtual double eval (const DataVector &x, DataVector &gradient, DataMatrix &hessian)=0
 Pure virtual method for calculating \(f(\vec{x})\) together with \(\nabla f(\vec{x})\) and \(H_f(\vec{x}) \in \mathbb{R}^{d \times d}\).
 
size_t getNumberOfParameters () const
 
 ScalarFunctionHessian (size_t d)
 Constructor.
 
virtual ~ScalarFunctionHessian ()
 Destructor.
 

Protected Attributes

size_t d
 dimension of the domain
 

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\) and Hessians \(H_f\colon [0, 1]^d \to \mathbb{R}^{d \times d}\) (e.g., Hessians of objective functions in optimization).

Constructor & Destructor Documentation

◆ ScalarFunctionHessian()

sgpp::base::ScalarFunctionHessian::ScalarFunctionHessian ( size_t  d)
inlineexplicit

Constructor.

Parameters
ddimension of the domain

◆ ~ScalarFunctionHessian()

virtual sgpp::base::ScalarFunctionHessian::~ScalarFunctionHessian ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ clone()

virtual void sgpp::base::ScalarFunctionHessian::clone ( std::unique_ptr< ScalarFunctionHessian > &  clone) const
pure virtual

Pure virtual method for cloning the Hessian.

It should generate a pointer to the cloned object and it's used for parallel computations (the eval() method might not be thread-safe).

Parameters
[out]clonepointer to cloned object

Implemented in sgpp::base::ComponentScalarFunctionHessian, sgpp::base::InterpolantScalarFunctionHessian, sgpp::base::ScaledScalarFunctionHessian, and sgpp::base::WrapperScalarFunctionHessian.

◆ eval() [1/2]

void sgpp::base::ScalarFunctionHessian::eval ( const DataMatrix x,
DataVector value,
DataMatrix gradient,
std::vector< DataMatrix > &  hessian 
)
inline

Convenience method for calculating \(f(\vec{x})\) together with \(\nabla f(\vec{x})\) and \(H_f(\vec{x}) \in \mathbb{R}^{d \times d}\) for multiple \(\vec{x}\).

Parameters
xmatrix \(\vec{x} \in [0, 1]^{N \times d}\) of evaluation points (row-wise)
[out]valuevector 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]gradientmatrix of size \(N \times d\) where the \(k\)-th row is \(\nabla f(\vec{x}_k)\)
[out]hessian\(N\)-vector of Hessians \(\nabla^2 f(\vec{x}_k) \in \mathbb{R}^{d \times d}\)

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().

◆ eval() [2/2]

virtual double sgpp::base::ScalarFunctionHessian::eval ( const DataVector x,
DataVector gradient,
DataMatrix hessian 
)
pure virtual

Pure virtual method for calculating \(f(\vec{x})\) together with \(\nabla f(\vec{x})\) and \(H_f(\vec{x}) \in \mathbb{R}^{d \times d}\).

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

Implemented in sgpp::base::ComponentScalarFunctionHessian, sgpp::base::InterpolantScalarFunctionHessian, sgpp::base::ScaledScalarFunctionHessian, and sgpp::base::WrapperScalarFunctionHessian.

Referenced by python.uq.analysis.asgc.ASGCAnalysis.ASGCAnalysis::estimateDensity(), eval(), and sgpp::base::ComponentScalarFunctionHessian::eval().

◆ getNumberOfParameters()

size_t sgpp::base::ScalarFunctionHessian::getNumberOfParameters ( ) const
inline
Returns
dimension \(d\) of the domain

References d.

Member Data Documentation

◆ d


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