69 nbParams_ = params.size();
70 if (nbParams_ == 0)
return;
73 unsigned int nbEvalMax = nbEvalMax_ /
static_cast<unsigned int>(nbParams_);
74 optimizer_.setMaximumNumberOfEvaluations(nbEvalMax);
75 optimizer_.setProfiler(getProfiler());
76 optimizer_.setMessageHandler(getMessageHandler());
77 optimizer_.getStopCondition()->setTolerance(getStopCondition()->getTolerance());
78 optimizer_.setConstraintPolicy(getConstraintPolicy());
79 optimizer_.setVerbose(getVerbose() > 0 ? getVerbose() - 1 : 0);
80 optimizer_.setMaximumNumberOfCorrections(10);
81 getFunction()->setParameters(getParameters());
89 for (
unsigned int i = 0; i <
nbParams_; i++)
unsigned int getNumberOfEvaluations() const
Get the number of function evaluations performed since the call of the init function.
unsigned int getVerbose() const
Get the verbose level.
This class allows to perform a correspondence analysis.
double optimize()
Basic implementation.
virtual bool matchParametersValues(const ParameterList ¶ms, std::vector< size_t > *updatedParameters=0)
Update the parameters from params.
This is the function abstract class.
ParameterList & getParameters_()
Stop condition on function value.
The parameter list object.
void setFunction(Function *function)
Set the function to optimize.
bool tolIsReached_
Tell if the tolerance level has been reached.
void setOptimizationProgressCharacter(const std::string &c)
Set the character to be displayed during optimization.
void setDefaultStopCondition_(OptimizationStopCondition *osc)
const Function * getFunction() const
Get the current function being optimized.
const ParameterList & getParameters() const
double doStep()
This function is called by the step() method and contains all calculations.
void setFunction(Function *function)
Set the function to optimize.
This is the abstract class for second order derivable functions.
unsigned int nbEval_
The current number of function evaluations achieved.
Partial implementation of the Optimizer interface.
NewtonOneDimension optimizer_
void setStopCondition(const OptimizationStopCondition &stopCondition)
Set the stop condition of the optimization algorithm.
SimpleNewtonMultiDimensions(DerivableSecondOrder *function)
OptimizationStopCondition * getDefaultStopCondition()
Get the default stop condition of the optimization algorithm.
virtual double getValue() const =0
Get the value of the function at the current point.
void doInit(const ParameterList ¶ms)
This function is called by the init() method and contains all calculations.
void init(const ParameterList ¶ms)
Basic implementation.