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

One component of a vector-valued function Hessian. More...

#include <ComponentScalarFunctionHessian.hpp>

Inheritance diagram for sgpp::base::ComponentScalarFunctionHessian:
sgpp::base::ScalarFunctionHessian

Public Member Functions

void clone (std::unique_ptr< ScalarFunctionHessian > &clone) const override
 
 ComponentScalarFunctionHessian (ScalarFunctionHessian &fHessian, std::vector< double > defaultValues=std::vector< double >())
 Constructor.
 
 ComponentScalarFunctionHessian (VectorFunctionHessian &fHessian, size_t k, std::vector< double > defaultValues=std::vector< double >())
 Constructor.
 
double eval (const DataVector &x, DataVector &gradient, DataMatrix &hessian) override
 
 ~ComponentScalarFunctionHessian () override
 Destructor.
 
- Public Member Functions inherited from sgpp::base::ScalarFunctionHessian
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}\).
 
size_t getNumberOfParameters () const
 
 ScalarFunctionHessian (size_t d)
 Constructor.
 
virtual ~ScalarFunctionHessian ()
 Destructor.
 

Protected Member Functions

void initialize ()
 

Protected Attributes

std::vector< double > defaultValues
 vector of default values, indicating free variables with NAN
 
size_t dF
 dimension of underlying function
 
ScalarFunctionHessianfHessianScalar
 scalar-valued function Hessian
 
VectorFunctionHessianfHessianVector
 vector-valued function Hessian
 
size_t k
 index of component
 
DataMatrix tmpMat
 temporary matrix
 
DataVector tmpVec1
 temporary vector 1
 
DataVector tmpVec2
 temporary vector 2
 
std::vector< DataMatrixtmpVecMat
 temporary vector of matrices
 
- Protected Attributes inherited from sgpp::base::ScalarFunctionHessian
size_t d
 dimension of the domain
 

Detailed Description

One component of a vector-valued function Hessian.

See also
ComponentScalarFunction

Constructor & Destructor Documentation

◆ ComponentScalarFunctionHessian() [1/2]

sgpp::base::ComponentScalarFunctionHessian::ComponentScalarFunctionHessian ( ScalarFunctionHessian fHessian,
std::vector< double >  defaultValues = std::vector<double>() 
)
inline

Constructor.

Use it like this: ComponentScalarFunctionHessian gHessian(fHessian, {NAN, NAN, 0.42}); where fHessian is a scalar-valued function Hessian with 3 parameters. This selects the first two parameters of fHessian, while constantly using 0.42 for the third parameter.

Parameters
fHessianscalar-valued function Hessian
defaultValuesVector of constant default values. It can be either empty (the default) or a vector of exactly m doubles, each of which can be finite or NAN. If the vector is empty, it will be initialized as m NANs (i.e., no restriction of the parameter domain). Each NAN represents a free parameter \(x_t\), while the finite entries denote the constant values for the corresponding parameter.

References initialize().

◆ ComponentScalarFunctionHessian() [2/2]

sgpp::base::ComponentScalarFunctionHessian::ComponentScalarFunctionHessian ( VectorFunctionHessian fHessian,
size_t  k,
std::vector< double >  defaultValues = std::vector<double>() 
)
inline

Constructor.

Use it like this: ComponentScalarFunctionHessian gHessian(fHessian, 3, {NAN, NAN, 0.42}); where fHessian is a vector-valued function Hessian with 5 components and 3 parameters. This selects the first two parameters and the fourth component of fHessian, while constantly using 0.42 for the third parameter.

Parameters
fHessianvector-valued function Hessian (m components)
kindex of component \(f_k\) to select (between 0 and m - 1)
defaultValuessee other constructor

References initialize().

◆ ~ComponentScalarFunctionHessian()

sgpp::base::ComponentScalarFunctionHessian::~ComponentScalarFunctionHessian ( )
inlineoverride

Destructor.

Member Function Documentation

◆ clone()

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

Implements sgpp::base::ScalarFunctionHessian.

References clone().

Referenced by clone().

◆ eval()

double sgpp::base::ComponentScalarFunctionHessian::eval ( const DataVector x,
DataVector gradient,
DataMatrix hessian 
)
inlineoverridevirtual
Parameters
[in]xevaluation point \(\vec{x} \in [0, 1]^n\)
[out]gradient\(\nabla_{\vec{x}} g(\vec{x})\)
[out]hessian\(\nabla_{\vec{x}}^2 g(\vec{x})\)
Returns
\(g(\vec{x}) := f_k(y_1, \dotsc, y_d)\) where \((x_1, \dotsc, x_n) = (y_{i_1}, \dotsc, y_{i_n})\)

Implements sgpp::base::ScalarFunctionHessian.

References defaultValues, dF, sgpp::base::ScalarFunctionHessian::eval(), sgpp::base::VectorFunctionHessian::eval(), fHessianScalar, fHessianVector, k, tmpMat, tmpVec1, tmpVec2, and tmpVecMat.

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

◆ initialize()

void sgpp::base::ComponentScalarFunctionHessian::initialize ( )
inlineprotected

Member Data Documentation

◆ defaultValues

std::vector<double> sgpp::base::ComponentScalarFunctionHessian::defaultValues
protected

vector of default values, indicating free variables with NAN

Referenced by eval(), and initialize().

◆ dF

size_t sgpp::base::ComponentScalarFunctionHessian::dF
protected

dimension of underlying function

Referenced by eval(), and initialize().

◆ fHessianScalar

ScalarFunctionHessian* sgpp::base::ComponentScalarFunctionHessian::fHessianScalar
protected

scalar-valued function Hessian

Referenced by eval().

◆ fHessianVector

VectorFunctionHessian* sgpp::base::ComponentScalarFunctionHessian::fHessianVector
protected

vector-valued function Hessian

Referenced by eval().

◆ k

◆ tmpMat

DataMatrix sgpp::base::ComponentScalarFunctionHessian::tmpMat
protected

temporary matrix

Referenced by eval().

◆ tmpVec1

DataVector sgpp::base::ComponentScalarFunctionHessian::tmpVec1
protected

temporary vector 1

Referenced by eval(), and initialize().

◆ tmpVec2

DataVector sgpp::base::ComponentScalarFunctionHessian::tmpVec2
protected

temporary vector 2

Referenced by eval().

◆ tmpVecMat

std::vector<DataMatrix> sgpp::base::ComponentScalarFunctionHessian::tmpVecMat
protected

temporary vector of matrices

Referenced by eval().


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