CDT++ 1.0.0
Causal Dynamical Triangulations in C++
Loading...
Searching...
No Matches
Move_tracker.hpp File Reference

Track ergodic moves. More...

#include <array>
#include <cstddef>
#include <gsl/util>
#include <numeric>
#include <optional>
#include <random>
#include <span>
#include <string_view>
#include <type_traits>
#include "Settings.hpp"
Include dependency graph for Move_tracker.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cdt::move_tracker::MoveTracker
 The data and methods to track ergodic moves. More...

Namespaces

namespace  cdt
 clang-15 does not support std::format

Enumerations

enum class  cdt::move_tracker::MoveType {
  TWO_THREE = 0 , THREE_TWO = 1 , TWO_SIX = 2 , SIX_TWO = 3 ,
  FOUR_FOUR = 4
}
 The types of 3D ergodic moves. More...

Functions

template<typename Enumeration>
constexpr auto cdt::move_tracker::as_integer (Enumeration const value) noexcept -> std::underlying_type_t< Enumeration >
 Convert enum to integer.
constexpr auto cdt::move_tracker::format_as (MoveType const move) noexcept -> std::string_view
 Enable direct formatting through fmt/spdlog.
template<std::uniform_random_bit_generator Generator>
auto cdt::move_tracker::generate_random_move_3 (Generator &generator) -> MoveType
 Generate a uniformly distributed 3D move from caller-owned RNG.
constexpr auto cdt::move_tracker::move_from_index (std::size_t const move_choice) noexcept -> std::optional< MoveType >
 Convert an integer index to MoveType.

Variables

constexpr std::size_t cdt::move_tracker::NUMBER_OF_3D_MOVES = 5
 Number of supported Pachner move kinds in three dimensions.

Detailed Description

Track ergodic moves.

Author
Adam Getchell

Definition in file Move_tracker.hpp.

Enumeration Type Documentation

◆ MoveType

enum class cdt::move_tracker::MoveType
nodiscardstrong

The types of 3D ergodic moves.

Enumerator
TWO_THREE 

Replace two tetrahedra with three.

THREE_TWO 

Replace three tetrahedra with two.

TWO_SIX 

Replace two tetrahedra with six.

SIX_TWO 

Replace six tetrahedra with two.

FOUR_FOUR 

Exchange a causal four-tetrahedron diamond.

Definition at line 34 of file Move_tracker.hpp.

Function Documentation

◆ as_integer()

template<typename Enumeration>
auto cdt::move_tracker::as_integer ( Enumeration const value) -> std::underlying_type_t< Enumeration >
nodiscardconstexprnoexcept

Convert enum to integer.

Template Parameters
EnumerationThe enum type
Parameters
valueThe enum
Returns
The integer value of the enum

Definition at line 69 of file Move_tracker.hpp.

◆ format_as()

auto cdt::move_tracker::format_as ( MoveType const move) -> std::string_view
nodiscardconstexprnoexcept

Enable direct formatting through fmt/spdlog.

Parameters
movePachner move kind.
Returns
Stable tuple notation for the move.

Definition at line 46 of file Move_tracker.hpp.

References FOUR_FOUR, SIX_TWO, THREE_TWO, TWO_SIX, and TWO_THREE.

◆ generate_random_move_3()

template<std::uniform_random_bit_generator Generator>
auto cdt::move_tracker::generate_random_move_3 ( Generator & generator) -> MoveType
inlinenodiscard

Generate a uniformly distributed 3D move from caller-owned RNG.

Template Parameters
GeneratorUniform random bit generator type.
Parameters
generatorGenerator whose state advances during sampling.
Returns
One uniformly sampled MoveType.

Definition at line 96 of file Move_tracker.hpp.

◆ move_from_index()

auto cdt::move_tracker::move_from_index ( std::size_t const move_choice) -> std::optional< MoveType >
nodiscardconstexprnoexcept

Convert an integer index to MoveType.

Parameters
move_choiceThe zero-based move index
Returns
The MoveType, or std::nullopt when the index is out of range

Definition at line 80 of file Move_tracker.hpp.

References FOUR_FOUR, SIX_TWO, THREE_TWO, TWO_SIX, and TWO_THREE.

Variable Documentation

◆ NUMBER_OF_3D_MOVES

std::size_t cdt::move_tracker::NUMBER_OF_3D_MOVES = 5
inlineconstexpr

Number of supported Pachner move kinds in three dimensions.

Definition at line 29 of file Move_tracker.hpp.