11#ifndef CDT_PLUSPLUS_MOVE_TRACKER_HPP
12#define CDT_PLUSPLUS_MOVE_TRACKER_HPP
30 enum class [[nodiscard(
"This contains data!")]]
move_type{
31 TWO_THREE = 0, THREE_TWO = 1, TWO_SIX = 2, SIX_TWO = 3, FOUR_FOUR = 4};
39 template <
typename Enumeration>
40 auto as_integer(Enumeration value) -> std::underlying_type_t<Enumeration>
42 return static_cast<std::underlying_type_t<Enumeration>
>(value);
52 if (move_choice == 0) {
return move_type::TWO_THREE; }
53 if (move_choice == 1) {
return move_type::THREE_TWO; }
54 if (move_choice == 2) {
return move_type::TWO_SIX; }
55 if (move_choice == 3) {
return move_type::SIX_TWO; }
56 return move_type::FOUR_FOUR;
65 auto move_choice = utilities::generate_random_int(0, 4);
67 fmt::print(
"Move choice = {}\n", move_choice);
79 if (dim == 3) {
return NUMBER_OF_3D_MOVES; }
80 if (dim == 4) {
return NUMBER_OF_4D_MOVES; }
88 template <
typename ManifoldType>
94 Container moves = {0};
110 return gsl::at(moves, index);
130 for (std::size_t i = 0; i < moves.size(); ++i)
132 moves[i] += rhs.moves[i];
143 return std::accumulate(moves.begin(), moves.end(), 0);
150 auto size() const noexcept {
return moves.size(); }
auto generate_random_move_3() -> move_type
Generate random 3D ergodic move.
auto as_integer(Enumeration value) -> std::underlying_type_t< Enumeration >
Convert enum to integer.
move_type
The types of 3D ergodic moves.
auto constexpr moves_per_dimension(Int_precision const dim) -> Int_precision
Determine the ergodic moves for a given dimensionality.
auto as_move(int const move_choice) -> move_type
Convert integer to move_type.
Global integer and precision settings.
std::int_fast32_t Int_precision
The data and methods to track ergodic moves.
auto operator+=(MoveTracker const &rhs)
The += operator for MoveTracker.
auto two_six_moves() const
Read access to (2,6) moves.
auto four_six_moves() const
Read access to (4,6) moves.
auto six_two_moves() const
Read access to (6,2) moves.
auto two_three_moves() const
Read access to (2,3) moves.
auto two_four_moves() const
Read access to (2,4) moves.
auto two_eight_moves() const
Read access to (2,8) moves.
auto two_six_moves() -> auto &
Write access to (2,6) moves.
auto three_three_moves() -> auto &
Write access to (3,3) moves.
auto three_three_moves() const
Read access to (3,3) moves.
auto two_eight_moves() -> auto &
Write access to (2,8) moves.
auto four_two_moves() const
Read access to (4,2) moves.
auto six_four_moves() const
Read access to (6,4) moves.
auto two_four_moves() -> auto &
Write access to (2,4) moves.
auto three_two_moves() const
Read access to (3,2) moves.
auto size() const noexcept
Container size.
auto four_six_moves() -> auto &
Write access to (4,6) moves.
auto four_two_moves() -> auto &
Write access to (4,2) moves.
auto total() const noexcept
Total moves.
auto moves_view() const
Get a view of the moves.
auto four_four_moves() -> auto &
Write access to (4,4) moves.
auto six_four_moves() -> auto &
Write access to (6,4) moves.
auto eight_two_moves() -> auto &
Write access to (8,2) moves.
void reset()
Reset all moves counts to zero.
auto operator[](gsl::index index) -> auto &
The [] operator for MoveTracker.
auto six_two_moves() -> auto &
Write access to (6,2) moves.
auto eight_two_moves() const
Read access to (8,2) moves.
auto three_two_moves() -> auto &
Write access to (3,2) moves.
auto operator[](move_type const move) const -> auto &
The [] operator for MoveTracker.
auto two_three_moves() -> auto &
Write access to (2,3) moves.
auto four_four_moves() const
Read access to (4,4) moves.