Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
mirtk::LocalOptimizer Class Referenceabstract

#include <LocalOptimizer.h>

Inheritance diagram for mirtk::LocalOptimizer:
Inheritance graph
Collaboration diagram for mirtk::LocalOptimizer:
Collaboration graph

Public Types

typedef ObjectFactory< enum OptimizationMethod, LocalOptimizerFactoryType
 Type of optimizer factory.
 

Public Member Functions

void AddStoppingCriterion (StoppingCriterion *)
 Add stopping criterion and take over ownership of the object.
 
void ClearStoppingCriteria ()
 Delete all stopping criteria.
 
virtual void Initialize ()
 Initialize optimization.
 
int NumberOfStoppingCriteria () const
 Get number of stopping criteria.
 
virtual enum OptimizationMethod OptimizationMethod () const =0
 Optimization method implemented by this optimizer.
 
virtual ParameterList Parameter () const
 Get parameters as key/value as string map.
 
void RemoveStoppingCriterion (StoppingCriterion *)
 Remove stopping criterion and revoke ownership of the object.
 
virtual double Run ()=0
 
virtual bool Set (const char *, const char *)
 Set parameter value from string.
 
class StoppingCriterionStoppingCriterion (int)
 Get the n-th stopping criterion.
 
const class StoppingCriterionStoppingCriterion (int) const
 Get the n-th stopping criterion.
 
virtual ~LocalOptimizer ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Observable
void AddObserver (Observer &)
 Add observer.
 
void Broadcast (Event, const void *=NULL)
 Broadcast event to observers.
 
void ClearObservers ()
 Delete all observers.
 
void DeleteObserver (Observer &)
 Delete observer.
 
void NotifyObservers (Event, const void *=NULL)
 Notify all observers about given event if this object has changed.
 
int NumberOfObservers () const
 Number of current observers.
 
virtual ~Observable ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Object
virtual const char * NameOfClass () const =0
 Get name of class, which this object is an instance of.
 
bool Parameter (const ParameterList &)
 Set parameters from name/value pairs.
 
virtual ~Object ()
 Destructor.
 

Static Public Member Functions

static FactoryTypeFactory ()
 Get global optimizer factory instance.
 
static LocalOptimizerNew (enum OptimizationMethod, ObjectiveFunction *=NULL)
 Construct optimizer.
 
- Static Public Member Functions inherited from mirtk::Object
static const char * NameOfType ()
 Get name of this class type.
 

Protected Member Functions

virtual bool Converged (int iter, double value, const double *delta)
 
bool IsImprovement (double prev, double value) const
 
 LocalOptimizer (ObjectiveFunction *=NULL)
 Constructor.
 
 LocalOptimizer (const LocalOptimizer &)
 Copy constructor.
 
LocalOptimizeroperator= (const LocalOptimizer &)
 Assignment operator.
 
- Protected Member Functions inherited from mirtk::Observable
 Observable ()
 Default constructor.
 
 Observable (const Observable &)
 Copy constructor.
 
Observableoperator= (const Observable &)
 Assignment operator.
 
- Protected Member Functions inherited from mirtk::Object
template<typename... Args>
void Throw (ErrorType err, const char *func, Args... args) const
 

Additional Inherited Members

- Static Protected Member Functions inherited from mirtk::Object
template<typename... Args>
static void ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args)
 

Detailed Description

Minimizes objective function without guarantee of global solution

Definition at line 43 of file LocalOptimizer.h.

Member Function Documentation

§ Converged()

virtual bool mirtk::LocalOptimizer::Converged ( int  iter,
double  value,
const double *  delta 
)
protectedvirtual

Test stopping criteria

The objective function must be up-to-date when this function is called. This is usually the case anyway because the current objective function value after a change of the parameters must be evaluated before this function is called to be able to provide this value as argument.

Note
The objective function value may be infinite in case of a non-parametric deformable surface model. In this case, stopping criteria are based only on the current surface geometry or last node displacements. Stopping criteria based on the objective function value should never be fulfilled in this case and always return false.
Parameters
[in]iterCurrent number of iterations.
[in]valueObjective function value at current iteration.
[in]deltaLast change of objective function parameters.
Returns
True when at least one stopping criterion is fulfilled.

§ IsImprovement()

bool mirtk::LocalOptimizer::IsImprovement ( double  prev,
double  value 
) const
inlineprotected

Test whether a given function value is better than another

Parameters
[in]prevObjective function value at previous iteration.
[in]valueObjective function value at current iteration.

Definition at line 216 of file LocalOptimizer.h.

§ Run()

virtual double mirtk::LocalOptimizer::Run ( )
pure virtual

Run optimization

Returns
Value of local minimum (maximum) of objective function

Implemented in mirtk::EulerMethod, mirtk::GradientDescent, mirtk::LineSearch, mirtk::LimitedMemoryBFGSDescent, mirtk::BrentLineSearch, mirtk::AdaptiveLineSearch, and mirtk::MaxStepLineSearch.


The documentation for this class was generated from the following file: