5 #include "../NumTools.h" 6 #include "../VectorTools.h" 18 lastParametersEstimates_(),
19 newParametersEstimates_()
24 cout <<
"DEBUG: WARNING!!! No parameter passed to ParametersStopCondition constructor. " 25 <<
"Be sure to have initialized the Optimizer first!" << endl;
39 cout <<
"DEBUG: WARNING!!! No parameter passed to ParametersStopCondition constructor. " 40 <<
"Be sure to have initialized the Optimizer first!" << endl;
54 cout <<
"DEBUG: WARNING!!! No parameter passed to ParametersStopCondition constructor. " 55 <<
"Be sure to have initialized the Optimizer first!" << endl;
70 cout <<
"DEBUG: WARNING!!! No parameter passed to ParametersStopCondition constructor. " 71 <<
"Be sure to have initialized the Optimizer first!" << endl;
98 double tol = NumTools::abs<double>(newEstimate - lastEstimate);
119 double tol = NumTools::abs<double>(newEstimate - lastEstimate);
136 lastFunctionValue_(-log(0.)),
137 newFunctionValue_(-log(0.))
virtual std::shared_ptr< const FunctionInterface > getFunction() const =0
Get the current function being optimized.
double lastFunctionValue_
The last value of the function.
virtual const Parameter & parameter(const std::string &name) const
Get the parameter with name name.
This class is designed to facilitate the manipulation of parameters.
double getCurrentTolerance() const
Get the current tolerance.
void init()
Initialize the condition.
virtual double getFunctionValue() const =0
Get the current function value.
const OptimizerInterface * optimizer_
double newFunctionValue_
The new value of the function.
void init()
Initialize the condition.
virtual ~FunctionStopCondition()
virtual const ParameterList & getParameters() const =0
virtual const std::string & getName() const
Get the name of this parameter.
bool isToleranceReached() const
Tell if the we reached the desired tolerance with a given new set of estimates.
This is the basal interface for all optimization methods.
double callCount_
Count the number of times the isToleranceReached() function has been called.
virtual double getValue() const
Get the value of this parameter.
Partial implementation of the OptimizationStopCondition interface.
FunctionStopCondition(const OptimizerInterface *optimizer)