One component of a vector-valued function Hessian.
More...
#include <ComponentScalarFunctionHessian.hpp>
One component of a vector-valued function Hessian.
- See also
- ComponentScalarFunction
◆ 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
-
fHessian | scalar-valued function Hessian |
defaultValues | Vector 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
-
fHessian | vector-valued function Hessian (m components) |
k | index of component \(f_k\) to select (between 0 and m - 1) |
defaultValues | see other constructor |
References initialize().
◆ ~ComponentScalarFunctionHessian()
sgpp::optimization::ComponentScalarFunctionHessian::~ComponentScalarFunctionHessian |
( |
| ) |
|
|
inlineoverride |
◆ clone()
void sgpp::optimization::ComponentScalarFunctionHessian::clone |
( |
std::unique_ptr< ScalarFunctionHessian > & |
clone | ) |
const |
|
inlineoverridevirtual |
◆ eval()
- Parameters
-
[in] | x | evaluation 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 |
◆ 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 |
◆ fHessianScalar
scalar-valued function Hessian
Referenced by eval().
◆ fHessianVector
vector-valued function Hessian
Referenced by eval().
size_t sgpp::optimization::ComponentScalarFunctionHessian::k |
|
protected |
index of component
Referenced by eval().
◆ tmpMat
temporary matrix
Referenced by eval().
◆ tmpVec1
temporary vector 1
Referenced by eval().
◆ tmpVec2
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: