![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/OptimizerWrapper.h>
Wrapper around Optimizer and CostFunction classes to work on simple lambda functions. More...
Wrapper around Optimizer and CostFunction classes to work on simple lambda functions.
Example usage:
Public Member Functions | |
OptimizerWrapper (std::function< double(int, const double *)> cf, int dim, int type=34) | |
Constructor with lambda cost function, dimension and optional NLopt type (BOBYQA by default) | |
OptimizerNL & | opt () |
Provides access to the underlying OptimizerNL instance for all detailed settings. | |
int | compute (std::vector< double > &pars) |
Executes the optimization with the given initial parameters. | |
int | compute () |
Executes the optimization with zero-initialized parameters. | |
double | evaluate (int n, const double *x, double *dx=0) override |
Forwards the cost function evaluation to the lambda function (derivatives not supported) | |
Protected Attributes | |
std::function< double(int, const double *)> | m_cf |
Cost function. | |
OptimizerNL | m_opt |
Optimizer instance. | |
|
inlineoverridevirtual |
Forwards the cost function evaluation to the lambda function (derivatives not supported)
Implements CostFunction.