![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/ParameterOptimization.h>
Class for combining a ParameterWrapperBase
instance with a cost function over C++ objects to produce a CostFunction that can be optimized over with an Optimizer
instance.
More...
Class for combining a ParameterWrapperBase
instance with a cost function over C++ objects to produce a CostFunction that can be optimized over with an Optimizer
instance.
Public Member Functions | |
ParameterOptimization (const std::function< double(void)> &costFunc, const ParameterWrapperBase &p) | |
Constructor that combines a set of optimization parameters with a cost function to create a CostFunction instance. | |
template<typename... Ts> | |
ParameterOptimization (const std::function< double(void)> &costFunc, Ts &&... params) | |
Convenience constructor that concatenates a list of parameters. | |
int | dimension () const |
double | evaluate (int n, const double *x, double *dx) override |
Implementation of the CostFunction interface. | |
double * | paramBuffer () |
Sets up a stored buffer containing the serialized parameters. | |
std::vector< std::string > | paramNames () const |
Returns names of parameters handled by this algorithm. | |
std::shared_ptr< Optimizer > | setupOptimizer (std::shared_ptr< Optimizer > opt=nullptr, double step=1.0, Progress *progress=nullptr) |
Setup an Optimizer to optimize over this instance. If no opt parameter is provided, a default optimizer is constructed. | |
double | eval () const |
Return the current value of the cost function. | |
|
overridevirtual |
Implementation of the CostFunction interface.
Calls deserialize of the parameter wrapper from x
, and returns the value of the cost function.
Implements CostFunction.
double * paramBuffer | ( | ) |
Sets up a stored buffer containing the serialized parameters.