SG++-Doxygen-Documentation
sgpp::optimization::ComponentScalarFunctionHessian Class Reference

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

#include <ComponentScalarFunctionHessian.hpp>

Inheritance diagram for sgpp::optimization::ComponentScalarFunctionHessian:
sgpp::optimization::ScalarFunctionHessian

Public Member Functions

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

Protected Member Functions

void initialize ()
 

Protected Attributes

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

Detailed Description

One component of a vector-valued function Hessian.

See also
ComponentScalarFunction

Constructor & Destructor Documentation

◆ ComponentScalarFunctionHessian() [1/2]

sgpp::optimization::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().

Referenced by clone().

◆ ComponentScalarFunctionHessian() [2/2]

sgpp::optimization::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::optimization::ComponentScalarFunctionHessian::~ComponentScalarFunctionHessian ( )
inlineoverride

Destructor.

Member Function Documentation

◆ clone()

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

Implements sgpp::optimization::ScalarFunctionHessian.

References ComponentScalarFunctionHessian().

◆ eval()

double sgpp::optimization::ComponentScalarFunctionHessian::eval ( const base::DataVector x,
base::DataVector gradient,
base::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::optimization::ScalarFunctionHessian.

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

◆ initialize()

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

References dF.

Referenced by ComponentScalarFunctionHessian().

Member Data Documentation

◆ defaultValues

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

vector of default values, indicating free variables with NAN

Referenced by eval().

◆ dF

size_t sgpp::optimization::ComponentScalarFunctionHessian::dF
protected

dimension of underlying function

Referenced by eval(), and initialize().

◆ fHessianScalar

ScalarFunctionHessian* sgpp::optimization::ComponentScalarFunctionHessian::fHessianScalar
protected

scalar-valued function Hessian

Referenced by eval().

◆ fHessianVector

VectorFunctionHessian* sgpp::optimization::ComponentScalarFunctionHessian::fHessianVector
protected

vector-valued function Hessian

Referenced by eval().

◆ k

size_t sgpp::optimization::ComponentScalarFunctionHessian::k
protected

index of component

Referenced by eval().

◆ tmpMat

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

temporary matrix

Referenced by eval().

◆ tmpVec1

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

temporary vector 1

Referenced by eval().

◆ tmpVec2

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

temporary vector 2

Referenced by eval().

◆ tmpVecMat

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

temporary vector of matrices

Referenced by eval().


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