5 #ifndef BPP_NUMERIC_FUNCTION_OPTIMIZATIONSTOPCONDITION_H 6 #define BPP_NUMERIC_FUNCTION_OPTIMIZATIONSTOPCONDITION_H 9 #include "../ParameterList.h" 15 class OptimizerInterface;
56 virtual void init() = 0;
67 virtual bool isToleranceReached()
const = 0;
74 virtual void setTolerance(
double tolerance) = 0;
81 virtual double getTolerance()
const = 0;
91 virtual double getCurrentTolerance()
const = 0;
122 optimizer_(optimizer),
123 tolerance_(0.000001),
128 optimizer_(optimizer),
129 tolerance_(tolerance),
134 optimizer_(optimizer),
135 tolerance_(0.000001),
140 optimizer_(optimizer),
141 tolerance_(tolerance),
146 optimizer_(aosc.optimizer_),
147 tolerance_(aosc.tolerance_),
148 callCount_(aosc.callCount_),
149 burnin_(aosc.burnin_) {}
171 void init() { resetCounter(); }
175 virtual void setBurnin(
int burnin) { burnin_ = burnin; }
220 bool isToleranceReached()
const;
222 double getCurrentTolerance()
const;
264 bool isToleranceReached()
const;
265 double getCurrentTolerance()
const;
268 #endif // BPP_NUMERIC_FUNCTION_OPTIMIZATIONSTOPCONDITION_H
AbstractOptimizationStopCondition(const OptimizerInterface *optimizer, double tolerance, int burnin)
double lastFunctionValue_
The last value of the function.
double getTolerance() const
Get the tolerance parameter.
virtual int getBurnin() const
AbstractOptimizationStopCondition(const OptimizerInterface *optimizer, int burnin)
Interface for otimization stop condition objet.
Stop condition on function value.
The parameter list object.
virtual void resetCounter()
AbstractOptimizationStopCondition(const OptimizerInterface *optimizer, double tolerance)
virtual ~OptimizationStopCondition()
void setOptimizer(const OptimizerInterface *optimizer)
Set the optimizer attached to this instance.
const OptimizerInterface * optimizer_
void setTolerance(double tolerance)
Set the tolerance parameter.
AbstractOptimizationStopCondition & operator=(const AbstractOptimizationStopCondition &aosc)
double newFunctionValue_
The new value of the function.
void init()
Initialize the condition.
virtual ~AbstractOptimizationStopCondition()
AbstractOptimizationStopCondition(const AbstractOptimizationStopCondition &aosc)
The Clonable interface (allow an object to be cloned).
This is the basal interface for all optimization methods.
const OptimizerInterface * getOptimizer() const
double callCount_
Count the number of times the isToleranceReached() function has been called.
virtual void setBurnin(int burnin)
Partial implementation of the OptimizationStopCondition interface.
FunctionStopCondition * clone() const
Create a copy of this object and send a pointer to it.
OptimizationStopCondition()
AbstractOptimizationStopCondition(const OptimizerInterface *optimizer)