14 : m_steps_per_pass(_steps_per_pass) {
20 throw std::runtime_error(
21 std::string(
"Error in MonteCounter constructor\n") +
22 " Zero or one of 'N_step', 'N_pass', and 'N_sample' should be given");
214 sout <<
"pass: " <<
m_pass <<
"\n";
215 sout <<
"step: " <<
m_step <<
"\n";
216 sout <<
"samples: " <<
m_samples <<
"\n";
219 sout <<
"m_max_pass: " <<
m_max_pass <<
"\n\n";
222 sout <<
"m_min_pass: " <<
m_min_pass <<
"\n\n";
225 sout <<
"m_max_step: " <<
m_max_step <<
"\n\n";
228 sout <<
"m_min_step: " <<
m_min_step <<
"\n\n";
234 sout <<
"m_min_sample: " <<
m_min_sample <<
"\n\n" << std::endl;
size_type min_step() const
Minimum number of steps, default 0 if sample by step.
bool is_max_step() const
Returns true if a maximum number of steps has been specified.
bool sample_by_pass() const
Sample by pass?
bool is_min_step() const
Returns true if a minimum number of steps has been specified.
bool is_N_pass() const
Returns true if the number of passes has been specified.
bool is_max_pass() const
Returns true if a maximum number of passes has been specified.
size_type max_sample() const
Maximum number of steps, default std::numeric_limit<size_type>::max()
size_type sample_period() const
Figure out how often to take samples.
size_type max_step() const
Maximum number of steps, required if sample by step.
bool is_min_pass() const
Returns true if a minimum number of passes has been specified.
size_type N_sample() const
Returns the number of samples requested.
size_type min_sample() const
Minimum number of steps, default 0.
size_type max_pass() const
Maximum number of passes, required if sample by pass.
bool is_N_sample() const
Returns true if the number of samples has been specified.
size_type N_pass() const
Returns the number of passes requested.
bool is_max_sample() const
Returns true if a maximum number of samples has been specified.
size_type min_pass() const
Minimum number of passes, default 0 if sample by pass.
bool is_min_sample() const
Returns true if a minimum number of samples has been specified.
size_type N_step() const
Returns the number of steps requested.
bool is_N_step() const
Returns true if the number of steps has been specified.
Track the number of passes, steps and samples taken in a Monte Carlo calculation.
bool sample_time() const
Returns true if based on period and current number of steps it is time to take a sample.
bool m_is_max_step
Maximum allowed number of steps.
void reset()
Set all counter variables back to 0.
bool maximums_met() const
Check if maximum number of pass, step, and samples has been met.
size_type m_step
Number of steps taken during the current pass.
bool m_is_N_step
Requested number of steps.
size_type samples() const
Number of samples taken.
SAMPLE_MODE m_sample_mode
Whether sampling mode is by SAMPLE_MODE::PASS or SAMPLE_MODE::STEP.
bool m_is_min_pass
Minimum allowed number of passes.
MonteCounter & operator++()
Prefix increment step and updates pass.
bool is_complete() const
Check if requested number of pass, step, or samples has been met.
bool m_is_N_pass
Requested number of passes.
bool minimums_met() const
Check if minimum number of pass, step, and samples has been met.
size_type m_samples
Number of data samples taken.
bool m_is_max_sample
Maximum allowed number of samples to take.
size_type steps_per_pass() const
Number of steps per pass.
size_type step() const
Number of steps into the current pass.
size_type m_since_last_sample
Number of passes or steps since last sample.
void increment_samples()
Increments the number of samples taken and resets counter until the next sample should be taken.
void debugprint(std::ostream &sout) const
bool m_is_max_pass
Maximum allowed number of passes.
void set(size_type _pass, size_type _step, size_type _samples)
Set all counter variables for performing a restart.
bool m_is_min_step
Minimum allowed number of steps.
MonteCounter(const EquilibriumMonteSettings &settings, size_type _steps_per_pass)
Construct a MonteCounter and initialize to all counts to zero.
bool m_is_N_sample
Requested number of samples.
bool m_is_min_sample
Minimum allowed number of samples to take.
size_type pass() const
Number of complete passes performed.