35 #ifndef GUM_APPROXIMATION_SCHEME_H 36 #define GUM_APPROXIMATION_SCHEME_H 313 const std::vector< double >&
history()
const;
424 #ifndef GUM_NO_INLINE 428 #endif // GUM_APPROXIMATION_SCHEME_H Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
double minEpsilonRate() const
Returns the value of the minimal epsilon rate.
void disableMinEpsilonRate()
Disable stopping criterion on epsilon rate.
bool _enabled_max_iter
If true, the maximum iterations stopping criterion is enabled.
double maxTime() const
Returns the timeout (in seconds).
bool _enabled_eps
If true, the threshold convergence is enabled.
void enableMinEpsilonRate()
Enable stopping criterion on epsilon rate.
void _stopScheme(ApproximationSchemeSTATE new_state)
Stop the scheme given a new state.
void setPeriodSize(Size p)
How many samples between two stopping is enable.
Size remainingBurnIn()
Returns the remaining burn in.
double _current_epsilon
Current epsilon.
bool _enabled_min_rate_eps
If true, the minimal threshold for epsilon rate is enabled.
bool startOfPeriod()
Returns true if we are at the beginning of a period (compute error is mandatory). ...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void initApproximationScheme()
Initialise the scheme.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void setMinEpsilonRate(double rate)
Given that we approximate f(t), stopping criterion on d/dt(|f(t+1)-f(t)|).
void setVerbosity(bool v)
Set the verbosity on (true) or off (false).
ApproximationScheme(bool verbosity=false)
Size periodSize() const
Returns the period size.
void setMaxTime(double timeout)
Stopping criterion on timeout.
Size _burn_in
Number of iterations before checking stopping criteria.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void disableEpsilon()
Disable stopping criterion on epsilon.
Size nbrIterations() const
Returns the number of iterations.
double _eps
Threshold for convergence.
double _current_rate
Current rate.
bool continueApproximationScheme(double error)
Update the scheme w.r.t the new error.
bool isEnabledMinEpsilonRate() const
Returns true if stopping criterion on epsilon rate is enabled, false otherwise.
bool _enabled_max_time
If true, the timeout is enabled.
void disableMaxTime()
Disable stopping criterion on timeout.
void enableMaxIter()
Enable stopping criterion on max iterations.
void stopApproximationScheme()
Stop the approximation scheme.
Size maxIter() const
Returns the criterion on number of iterations.
Size _current_step
The current step.
std::vector< double > _history
The scheme history, used only if verbosity == true.
Size _period_size
Checking criteria frequency.
double _min_rate_eps
Threshold for the epsilon rate.
const std::vector< double > & history() const
Returns the scheme history.
ApproximationSchemeSTATE stateApproximationScheme() const
Returns the approximation scheme state.
void setMaxIter(Size max)
Stopping criterion on number of iterations.
bool isEnabledMaxIter() const
Returns true if stopping criterion on max iterations is enabled, false otherwise. ...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool _verbosity
If true, verbosity is enabled.
bool verbosity() const
Returns true if verbosity is enabled.
double epsilon() const
Returns the value of epsilon.
double _last_epsilon
Last epsilon value.
bool isEnabledEpsilon() const
Returns true if stopping criterion on epsilon is enabled, false otherwise.
bool isEnabledMaxTime() const
Returns true if stopping criterion on timeout is enabled, false otherwise.
void setEpsilon(double eps)
Given that we approximate f(t), stopping criterion on |f(t+1)-f(t)|.
double currentTime() const
Returns the current running time in second.
void disableMaxIter()
Disable stopping criterion on max iterations.
Class used to compute response times for benchmark purposesThis class represents a classic timer...
std::size_t Size
In aGrUM, hashed values are unsigned long int.
ApproximationSchemeSTATE
The different state of an approximation scheme.
Size _max_iter
The maximum iterations.
ApproximationSchemeSTATE _current_state
The current state.
virtual ~ApproximationScheme()
double _max_time
The timeout.
void enableMaxTime()
Enable stopping criterion on timeout.
void updateApproximationScheme(unsigned int incr=1)
Update the scheme w.r.t the new error and increment steps.
void enableEpsilon()
Enable stopping criterion on epsilon.