ImFusion SDK 4.3
ParameterOptimization Class Reference

#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...

+ Inheritance diagram for ParameterOptimization:

Detailed Description

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.

See also
ParameterWrapperBase

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::stringparamNames () const
 Returns names of parameters handled by this algorithm.
 
std::shared_ptr< OptimizersetupOptimizer (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.
 

Member Function Documentation

◆ evaluate()

double evaluate ( int n,
const double * x,
double * dx )
overridevirtual

Implementation of the CostFunction interface.

Calls deserialize of the parameter wrapper from x, and returns the value of the cost function.

Implements CostFunction.

◆ paramBuffer()

double * paramBuffer ( )

Sets up a stored buffer containing the serialized parameters.

Returns
the buffer

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close