2#ifndef STORMM_TICKCOUNTER_H
3#define STORMM_TICKCOUNTER_H
8#include "DataTypes/stormm_vector_types.h"
9#include "Reporting/error_format.h"
10#include "Structure/local_arrangement.h"
11#include "Structure/structure_enumerators.h"
12#include "multiplication.h"
18using structure::imageValue;
19using structure::ImagingMethod;
33 const std::vector<int> &settings_in = std::vector<int>());
35 explicit TickCounter(
const std::vector<std::vector<T>> &state_values_in,
36 const std::vector<int> &settings_in = std::vector<int>());
116 template <
typename Trng>
void randomize(Trng *xrs,
const std::vector<bool> &apply_rng);
117 template <
typename Trng>
void randomize(Trng *xrs,
const std::vector<int> &apply_rng);
129 void set(
const std::vector<int> &new_state);
131 void set(
int new_state,
int var_index);
147 void loadStateValues(
const std::vector<std::vector<T>> &state_values_in);
152 double log_permutations;
153 std::vector<int> settings;
156 std::vector<int> state_limits;
158 std::vector<T> state_values;
165 std::vector<int> state_value_bounds;
171 void variableBoundsCheck(
const int var_index)
const;
175 void validateSettings()
const;
193template <
typename T,
typename T2>
194void loadScalarStateValues(
TickCounter<T> *tc,
const std::vector<T2> &ranges,
195 const std::vector<T> &periodic_boundaries);
197template <
typename T,
typename T2>
198void loadScalarStateValues(
TickCounter<T> *tc,
const std::vector<T2> &ranges);
204#include "tickcounter.tpp"
TickCounter(const std::vector< int > &state_limits_in, const std::vector< int > &settings_in=std::vector< int >())
The constructor takes a series of state counts for each "wheel" in the counter. The initial state can...
Make an array of integral settings and tick it forward (or backward). The analogy is a series of whee...
Definition tickcounter.h:26
int getVariableCount() const
Get the number of independent settings, the number of variables.
TickCounter(const TickCounter &original)=default
The copy and move constructors as well as assignment operators are all valid.
std::vector< T > getPossibleStates(int var_index) const
Get a vector of all possible states for one of the variables.
int getStateLimits(int var_index) const
Get the number of available states.
llint getExactPermutationCount() const
Get the exact number of permutations for this object.
void set(const std::vector< int > &new_state)
Set the object's state to an arbitrary series of values.
void reset()
Reset all states of the counter to zero.
double getLogPermutationCount() const
Get the natural logarithm of the number of permutations of this object.
T getState(int var_index) const
Get the state represented by a particular combination of settings, drawing on the internal representa...
void advance(int steps=1)
Advance the counter by a specified number of steps.
double getLogPermutations() const
Get the logarithm of the number of overall permutations.
const std::vector< int > & getSettings() const
Get a const reference to the vector of current settings.
void loadStateValues(const std::vector< T > &state_values_in, int var_index)
Load the available states for one or more independent variables.
void reverse(int steps=1)
Reverse the counter by a specified number of steps.
double getApproximatePermutationCount() const
Get the number of permutations count for this object as a floating-point number.
TickCounter(const std::vector< int > &state_limits_in, const std::vector< int > &settings_in=std::vector< int >())
The constructor takes a series of state counts for each "wheel" in the counter. The initial state can...
void randomize(Trng *xrs)
Randomize some or all variables of the object.