94 for (
unsigned int i = 0; i <
nbParams_; i++)
103 double t = std::max(0.000001, std::min(std::abs(v),
getStopCondition()->getTolerance()));
Partial implementation of the Optimizer interface.
void setOptimizationProgressCharacter(const std::string &c)
Set the character to be displayed during optimization.
void setFunction(Function *function)
Set the function to optimize.
void setProfiler(OutputStream *profiler)
Set the profiler for this optimizer.
void setConstraintPolicy(const std::string &constraintPolicy)
Set the constraint policy for this optimizer.
OutputStream * getMessageHandler() const
OutputStream * getProfiler() const
void setMessageHandler(OutputStream *mh)
Set the message handler for this optimizer.
OptimizationStopCondition * getDefaultStopCondition()
Get the default stop condition of the optimization algorithm.
unsigned int nbEvalMax_
The maximum number of function evaluations allowed.
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.
void init(const ParameterList ¶ms)
Basic implementation.
void setVerbose(unsigned int v)
Set the verbose level.
unsigned int getNumberOfEvaluations() const
Get the number of function evaluations performed since the call of the init function.
ParameterList & getParameters_()
OptimizationStopCondition * getStopCondition()
Get the stop condition of the optimization algorithm.
const Function * getFunction() const
Get the current function being optimized.
void setMaximumNumberOfEvaluations(unsigned int max)
Set the maximum number of function evaluation to perform during optimization.
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.
void setDefaultStopCondition_(OptimizationStopCondition *osc)
double optimize()
Initialize optimizer.
void setInitialInterval(double inf, double sup)
Set intial search interval.
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.
virtual void init()=0
Initialize the condition.
The parameter list object.
virtual bool matchParametersValues(const ParameterList ¶ms, std::vector< size_t > *updatedParameters=0)
Update the parameters from params.
SimpleMultiDimensions(Function *function)
void doInit(const ParameterList ¶ms)
This function is called by the init() method and contains all calculations.
double doStep()
This function is called by the step() method and contains all calculations.
BrentOneDimension optimizer_
void setFunction(Function *function)
Set the function to optimize.