54#ifndef GUM_APPROXIMATION_SCHEME_H
55#define GUM_APPROXIMATION_SCHEME_H
156 double epsilon()
const override;
259 double maxTime()
const override;
330 const std::vector< double >&
history()
const override;
This file contains getters and setters definition for ApproximationScheme settings.
Inline implementatioh of gum::ApproximationSettings.
Size remainingBurnIn() const
Returns the remaining burn in.
void updateApproximationScheme(unsigned int incr=1)
Update the scheme w.r.t the new error and increment steps.
Size current_step_
The current step.
double current_epsilon_
Current epsilon.
bool isEnabledEpsilon() const override
Returns true if stopping criterion on epsilon is enabled, false otherwise.
double last_epsilon_
Last epsilon value.
double eps_
Threshold for convergence.
void setMaxIter(Size max) override
Stopping criterion on number of iterations.
void disableMaxTime() override
Disable stopping criterion on timeout.
void setMaxTime(double timeout) override
Stopping criterion on timeout.
void enableMaxIter() override
Enable stopping criterion on max iterations.
double minEpsilonRate() const override
Returns the value of the minimal epsilon rate.
void setMinEpsilonRate(double rate) override
Given that we approximate f(t), stopping criterion on d/dt(|f(t+1)-f(t)|).
void disableEpsilon() override
Disable stopping criterion on epsilon.
bool enabled_max_time_
If true, the timeout is enabled.
Size max_iter_
The maximum iterations.
bool enabled_eps_
If true, the threshold convergence is enabled.
ApproximationSchemeSTATE current_state_
The current state.
double min_rate_eps_
Threshold for the epsilon rate.
double epsilon() const override
Returns the value of epsilon.
void setPeriodSize(Size p) override
How many samples between two stopping is enable.
bool isEnabledMaxTime() const override
Returns true if stopping criterion on timeout is enabled, false otherwise.
std::vector< double > history_
The scheme history, used only if verbosity == true.
double current_rate_
Current rate.
ApproximationSchemeSTATE stateApproximationScheme() const override
Returns the approximation scheme state.
void enableEpsilon() override
Enable stopping criterion on epsilon.
Size period_size_
Checking criteria frequency.
double currentTime() const override
Returns the current running time in second.
virtual ~ApproximationScheme()
bool isEnabledMinEpsilonRate() const override
Returns true if stopping criterion on epsilon rate is enabled, false otherwise.
bool startOfPeriod() const
Returns true if we are at the beginning of a period (compute error is mandatory).
bool enabled_max_iter_
If true, the maximum iterations stopping criterion is enabled.
double maxTime() const override
Returns the timeout (in seconds).
void disableMinEpsilonRate() override
Disable stopping criterion on epsilon rate.
Size periodSize() const override
Returns the period size.
void enableMaxTime() override
Enable stopping criterion on timeout.
double max_time_
The timeout.
ApproximationScheme(bool verbosity=false)
void initApproximationScheme()
Initialise the scheme.
Size nbrIterations() const override
Returns the number of iterations.
const std::vector< double > & history() const override
Returns the scheme history.
void stopScheme_(ApproximationSchemeSTATE new_state)
Stop the scheme given a new state.
Size maxIter() const override
Returns the criterion on number of iterations.
bool verbosity_
If true, verbosity is enabled.
void stopApproximationScheme()
Stop the approximation scheme.
void enableMinEpsilonRate() override
Enable stopping criterion on epsilon rate.
bool verbosity() const override
Returns true if verbosity is enabled.
bool isEnabledMaxIter() const override
Returns true if stopping criterion on max iterations is enabled, false otherwise.
bool continueApproximationScheme(double error)
Update the scheme w.r.t the new error.
void disableMaxIter() override
Disable stopping criterion on max iterations.
Size burn_in_
Number of iterations before checking stopping criteria.
void setVerbosity(bool v) override
Set the verbosity on (true) or off (false).
bool enabled_min_rate_eps_
If true, the minimal threshold for epsilon rate is enabled.
void setEpsilon(double eps) override
Given that we approximate f(t), stopping criterion on |f(t+1)-f(t)|.
IApproximationSchemeConfiguration()
Class constructors.
ApproximationSchemeSTATE
The different state of an approximation scheme.
Class used to compute response times for benchmark purposes.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
gum is the global namespace for all aGrUM entities