One component of a vector-valued function gradient.
More...
#include <ComponentScalarFunctionGradient.hpp>
One component of a vector-valued function gradient.
- See also
- ComponentScalarFunction
◆ ComponentScalarFunctionGradient() [1/2]
sgpp::optimization::ComponentScalarFunctionGradient::ComponentScalarFunctionGradient |
( |
ScalarFunctionGradient & |
fGradient, |
|
|
std::vector< double > |
defaultValues = std::vector<double>() |
|
) |
| |
|
inline |
Constructor.
Use it like this: ComponentScalarFunctionGradient gGradient(fGradient, {NAN, NAN, 0.42}); where fGradient is a scalar-valued function gradient with 3 parameters. This selects the first two parameters of fGradient, while constantly using 0.42 for the third parameter.
- Parameters
-
fGradient | scalar-valued function gradient |
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().
◆ ComponentScalarFunctionGradient() [2/2]
sgpp::optimization::ComponentScalarFunctionGradient::ComponentScalarFunctionGradient |
( |
VectorFunctionGradient & |
fGradient, |
|
|
size_t |
k, |
|
|
std::vector< double > |
defaultValues = std::vector<double>() |
|
) |
| |
|
inline |
Constructor.
Use it like this: ComponentScalarFunctionGradient gGradient(fGradient, 3, {NAN, NAN, 0.42}); where fGradient is a vector-valued function gradient with 5 components and 3 parameters. This selects the first two parameters and the fourth component of fGradient, while constantly using 0.42 for the third parameter.
- Parameters
-
fGradient | vector-valued function gradient (m components) |
k | index of component \(f_k\) to select (between 0 and m - 1) |
defaultValues | see other constructor |
References initialize().
◆ ~ComponentScalarFunctionGradient()
sgpp::optimization::ComponentScalarFunctionGradient::~ComponentScalarFunctionGradient |
( |
| ) |
|
|
inlineoverride |
◆ clone()
void sgpp::optimization::ComponentScalarFunctionGradient::clone |
( |
std::unique_ptr< ScalarFunctionGradient > & |
clone | ) |
const |
|
inlineoverridevirtual |
◆ eval()
- Parameters
-
[in] | x | evaluation point \(\vec{x} \in [0, 1]^n\) |
[out] | gradient | \(\nabla_{\vec{x}} 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::ScalarFunctionGradient.
References defaultValues, dF, sgpp::optimization::ScalarFunctionGradient::eval(), sgpp::optimization::VectorFunctionGradient::eval(), fGradientScalar, fGradientVector, k, tmpMat, tmpVec1, and tmpVec2.
◆ initialize()
void sgpp::optimization::ComponentScalarFunctionGradient::initialize |
( |
| ) |
|
|
inlineprotected |
◆ defaultValues
std::vector<double> sgpp::optimization::ComponentScalarFunctionGradient::defaultValues |
|
protected |
vector of default values, indicating free variables with NAN
Referenced by eval().
◆ dF
size_t sgpp::optimization::ComponentScalarFunctionGradient::dF |
|
protected |
◆ fGradientScalar
scalar-valued function gradient
Referenced by eval().
◆ fGradientVector
vector-valued function gradient
Referenced by eval().
size_t sgpp::optimization::ComponentScalarFunctionGradient::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().
The documentation for this class was generated from the following file: