46 #include "../../App/ApplicationTools.h"
63 optDesc_(desc), optParameters_(desc->getNumberOfOptimizers()),
64 nbParameters_(desc->getNumberOfOptimizers()), n_(n),
65 precisionStep_(-1.), stepCount_(0), initialValue_(-1.)
79 optParameters_(opt.optParameters_),
80 nbParameters_(opt.nbParameters_),
82 precisionStep_(opt.precisionStep_),
83 stepCount_(opt.stepCount_),
84 initialValue_(opt.initialValue_)
191 throw Exception(
"MetaOptimizer::step. Unknown iteration type specified.");
Partial implementation of the Optimizer interface.
void setOptimizationProgressCharacter(const std::string &c)
Set the character to be displayed during optimization.
OutputStream * getMessageHandler() const
OutputStream * getProfiler() const
OptimizationStopCondition * getDefaultStopCondition()
Get the default stop condition of the optimization algorithm.
unsigned int nbEval_
The current number of function evaluations achieved.
const ParameterList & getParameters() const
void setStopCondition(const OptimizationStopCondition &stopCondition)
Set the stop condition of the optimization algorithm.
ParameterList & getParameters_()
OptimizationStopCondition * getStopCondition()
Get the stop condition of the optimization algorithm.
const Function * getFunction() const
Get the current function being optimized.
std::string getConstraintPolicy() const
Get the constraint policy for this optimizer.
bool tolIsReached_
Tell if the tolerance level has been reached.
unsigned int getVerbose() const
Get the verbose level.
bool updateParameters() const
Tell if we shall update all parameters after one optimization step.
AbstractOptimizer & operator=(const AbstractOptimizer &opt)
void setDefaultStopCondition_(OptimizationStopCondition *osc)
This is the abstract class for first order derivable functions.
This is the abstract class for second order derivable functions.
Exception base class. Overload exception constructor (to control the exceptions mechanism)....
Stop condition on function value.
This is the function abstract class.
virtual double getValue() const =0
Get the value of the function at the current point.
virtual void setParameters(const ParameterList ¶meters)=0
Set the point where the function must be computed.
virtual void setTolerance(double tolerance)=0
Set the tolerance parameter.
virtual double getTolerance() const =0
Get the tolerance parameter.
This is the basal interface for all optimization methods.
virtual double step()=0
Perform an optimization step.
virtual void setConstraintPolicy(const std::string &constraintPolicy)=0
Set the constraint policy for this optimizer.
virtual void init(const ParameterList ¶ms)=0
Set the initial values of the parameters.
virtual void setVerbose(unsigned int v)=0
Set the verbose level.
virtual void setMessageHandler(OutputStream *mh)=0
Set the message handler for this optimizer.
virtual double optimize()=0
Perform as many optimization steps untill the stop condition is met.
virtual unsigned int getNumberOfEvaluations() const =0
Get the number of function evaluations performed since the call of the init function.
virtual OptimizationStopCondition * getStopCondition()=0
Get the stop condition of the optimization algorithm.
virtual const ParameterList & getParameters() const =0
virtual void setProfiler(OutputStream *profiler)=0
Set the profiler for this optimizer.
The parameter list object.
virtual bool hasParameter(const std::string &name) const
virtual const Parameter & getParameter(const std::string &name) const
Get the parameter with name name.
virtual bool matchParametersValues(const ParameterList ¶ms, std::vector< size_t > *updatedParameters=0)
Update the parameters from params.