Image Component Library (ICL)
|
Template based implementation for the Downhill Simplex Optimiztation method. More...
#include <SimplexOptimizer.h>
Public Types | |
typedef utils::Function< T, const Vector & > | error_function |
error function type that is used More... | |
typedef SimplexOptimizationResult< T, Vector > | Result |
typedef utils::Function< void, const Result & > | iteration_callback |
typedef utils::Function< Vector > | init_gen |
Public Member Functions | |
SimplexOptimizer (error_function f, int dim, int iterations=1E5, T minError=1.0E-10, T minDelta=1.0E-10, T a=1.0, T b=1.0, T g=0.5, T h=0.5) | |
creates a new instance with given parameters More... | |
void | setDim (int dim) |
sets the optimizers dimension (note, that usually the error function must be changed then as well) More... | |
void | setA (T a) |
sets the reflection factor More... | |
void | setB (T b) |
sets the extenxion factor More... | |
void | setG (T g) |
sets the contraction factor More... | |
void | setH (T h) |
sets the multiple contraction factor More... | |
void | setIterations (int iterations) |
sets the maximum iteration termination criterion More... | |
void | setMinError (T minError) |
sets the minimum error termination criterion More... | |
void | setMinDelta (T minDelta) |
sets the minimum delta termination criterion More... | |
void | setErrorFunction (error_function f) |
sets the error function More... | |
int | getDim () const |
returns the data dimesions More... | |
T | getA () const |
returns the reflection factor More... | |
T | getB () const |
returns the extension factor More... | |
T | getG () const |
returns the contraction factor More... | |
T | getH () const |
returns the multiple contraction factor More... | |
int | getIterations () const |
returns the maximum iteration termination criterion More... | |
T | getMinError () const |
returns the minimum error termination criterion More... | |
T | getMinDelta () const |
returns the minimum delta termination criterion More... | |
error_function | getErrorFunction () const |
returns the curren error function More... | |
void | setIterationCallback (const iteration_callback &cb) |
sets a callback function, that is called after every iteration step More... | |
Result | optimize (const Vector &init) |
runs an optimization using internal parameters starting at given input vector More... | |
Result | optimize (const std::vector< Vector > &init) |
runs an optimization using internal parameters using the given initial simplex More... | |
Result | optimize (init_gen gen, int nInitCycles) |
uses the inititalization generator to run the optimization several times with different initialization values More... | |
Static Public Member Functions | |
static std::vector< Vector > | createDefaultSimplex (const Vector &init) |
create a default simplex structure More... | |
Private Attributes | |
Data * | m_data |
internal data structure More... | |
Additional Inherited Members | |
Protected Member Functions inherited from icl::utils::Uncopyable | |
Uncopyable () | |
Empty base constructor. More... | |
Template based implementation for the Downhill Simplex Optimiztation method.
typedef utils::Function<T, const Vector&> icl::math::SimplexOptimizer< T, Vector >::error_function |
error function type that is used
typedef utils::Function<Vector> icl::math::SimplexOptimizer< T, Vector >::init_gen |
typedef utils::Function<void,const Result &> icl::math::SimplexOptimizer< T, Vector >::iteration_callback |
typedef SimplexOptimizationResult<T,Vector> icl::math::SimplexOptimizer< T, Vector >::Result |
icl::math::SimplexOptimizer< T, Vector >::SimplexOptimizer | ( | error_function | f, |
int | dim, | ||
int | iterations = 1E5 , |
||
T | minError = 1.0E-10 , |
||
T | minDelta = 1.0E-10 , |
||
T | a = 1.0 , |
||
T | b = 1.0 , |
||
T | g = 0.5 , |
||
T | h = 0.5 |
||
) |
creates a new instance with given parameters
f | error function |
dim | vector dimension (please note, for fixed dim vector types, this must still be set to the right value) |
iterations | maximum iteration count |
minError | minimum error termination criterion |
minDelta | minimum center movement termination criterion |
a | reflection factor (default 1.0) |
b | expansion factor (default 1.0) |
g | contration factor (default 0.5) |
h | multiple contraction factor (default 0.5) |
|
static |
create a default simplex structure
the initial simplex is created internally using the heuristic shown in the ALGO section.
T icl::math::SimplexOptimizer< T, Vector >::getA | ( | ) | const |
returns the reflection factor
T icl::math::SimplexOptimizer< T, Vector >::getB | ( | ) | const |
returns the extension factor
int icl::math::SimplexOptimizer< T, Vector >::getDim | ( | ) | const |
returns the data dimesions
error_function icl::math::SimplexOptimizer< T, Vector >::getErrorFunction | ( | ) | const |
returns the curren error function
T icl::math::SimplexOptimizer< T, Vector >::getG | ( | ) | const |
returns the contraction factor
T icl::math::SimplexOptimizer< T, Vector >::getH | ( | ) | const |
returns the multiple contraction factor
int icl::math::SimplexOptimizer< T, Vector >::getIterations | ( | ) | const |
returns the maximum iteration termination criterion
T icl::math::SimplexOptimizer< T, Vector >::getMinDelta | ( | ) | const |
returns the minimum delta termination criterion
T icl::math::SimplexOptimizer< T, Vector >::getMinError | ( | ) | const |
returns the minimum error termination criterion
Result icl::math::SimplexOptimizer< T, Vector >::optimize | ( | const Vector & | init | ) |
runs an optimization using internal parameters starting at given input vector
the initial simplex is created internally using the heuristic shown in the ALGO section.
Result icl::math::SimplexOptimizer< T, Vector >::optimize | ( | const std::vector< Vector > & | init | ) |
runs an optimization using internal parameters using the given initial simplex
the given input simplex must have init[0].dim+1 entries !
Result icl::math::SimplexOptimizer< T, Vector >::optimize | ( | init_gen | gen, |
int | nInitCycles | ||
) |
uses the inititalization generator to run the optimization several times with different initialization values
void icl::math::SimplexOptimizer< T, Vector >::setA | ( | T | a | ) |
sets the reflection factor
void icl::math::SimplexOptimizer< T, Vector >::setB | ( | T | b | ) |
sets the extenxion factor
void icl::math::SimplexOptimizer< T, Vector >::setDim | ( | int | dim | ) |
sets the optimizers dimension (note, that usually the error function must be changed then as well)
void icl::math::SimplexOptimizer< T, Vector >::setErrorFunction | ( | error_function | f | ) |
sets the error function
void icl::math::SimplexOptimizer< T, Vector >::setG | ( | T | g | ) |
sets the contraction factor
void icl::math::SimplexOptimizer< T, Vector >::setH | ( | T | h | ) |
sets the multiple contraction factor
void icl::math::SimplexOptimizer< T, Vector >::setIterationCallback | ( | const iteration_callback & | cb | ) |
sets a callback function, that is called after every iteration step
void icl::math::SimplexOptimizer< T, Vector >::setIterations | ( | int | iterations | ) |
sets the maximum iteration termination criterion
void icl::math::SimplexOptimizer< T, Vector >::setMinDelta | ( | T | minDelta | ) |
sets the minimum delta termination criterion
void icl::math::SimplexOptimizer< T, Vector >::setMinError | ( | T | minError | ) |
sets the minimum error termination criterion
|
private |
internal data structure
internal data pointer