42 #include "../NumTools.h"
43 #include "../VectorTools.h"
55 lastParametersEstimates_(),
56 newParametersEstimates_()
61 cout <<
"DEBUG: WARNING!!! No parameter passed to ParametersStopCondition constructor. "
62 <<
"Be sure to have initialized the Optimizer first!" << endl;
70 lastParametersEstimates_(),
71 newParametersEstimates_()
76 cout <<
"DEBUG: WARNING!!! No parameter passed to ParametersStopCondition constructor. "
77 <<
"Be sure to have initialized the Optimizer first!" << endl;
85 lastParametersEstimates_(),
86 newParametersEstimates_()
91 cout <<
"DEBUG: WARNING!!! No parameter passed to ParametersStopCondition constructor. "
92 <<
"Be sure to have initialized the Optimizer first!" << endl;
101 lastParametersEstimates_(),
102 newParametersEstimates_()
107 cout <<
"DEBUG: WARNING!!! No parameter passed to ParametersStopCondition constructor. "
108 <<
"Be sure to have initialized the Optimizer first!" << endl;
135 double tol = NumTools::abs<double>(newEstimate - lastEstimate);
156 double tol = NumTools::abs<double>(newEstimate - lastEstimate);
173 lastFunctionValue_(-log(0.)),
174 newFunctionValue_(-log(0.))
183 lastFunctionValue_(-log(0.)),
184 newFunctionValue_(-log(0.))
193 lastFunctionValue_(-log(0.)),
194 newFunctionValue_(-log(0.))
204 lastFunctionValue_(-log(0.)),
205 newFunctionValue_(-log(0.))
Partial implementation of the OptimizationStopCondition interface.
double callCount_
Count the number of times the isToleranceReached() function has been called.
const Optimizer * optimizer_
void init()
Initialize the condition.
virtual ~FunctionStopCondition()
double getCurrentTolerance() const
Get the current tolerance.
void init()
Initialize the condition.
double lastFunctionValue_
The last value of the function.
double newFunctionValue_
The new value of the function.
bool isToleranceReached() const
Tell if the we reached the desired tolerance with a given new set of estimates.
FunctionStopCondition(const Optimizer *optimizer)
This is the basal interface for all optimization methods.
virtual double getFunctionValue() const =0
Get the current function value.
virtual const ParameterList & getParameters() const =0
virtual const Function * getFunction() const =0
Get the current function being optimized.
virtual const Parameter & getParameter(const std::string &name) const
Get the parameter with name name.
This class is designed to facilitate the manipulation of parameters.
virtual double getValue() const
Get the value of this parameter.
virtual const std::string & getName() const
Get the name of this parameter.