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