84 x += 0x9e3779b97f4a7c15ull;
85 x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9ull;
86 x = (x ^ (x >> 27)) * 0x94d049bb133111ebull;
98 const std::uint64_t b)
noexcept
114template <std::
size_t Rank>
117 std::uint64_t
h = 0xcbf29ce484222325ull;
118 for (std::size_t d = 0; d <
Rank; ++d)
120 const std::uint64_t
component =
static_cast<std::uint64_t
>(
static_cast<std::int64_t
>(c[d]));
140template <std::
size_t Rank>
142 const std::size_t step,
146 =
splitmix64(
static_cast<std::uint64_t
>(step) + 0xa5a5a5a5a5a5a5a5ull);
159template <std::
size_t Rank>
182 const std::size_t step)
noexcept
187 =
splitmix64((
static_cast<std::uint64_t
>(step) << 32) ^ 0x0123456789abcdefull);
205template <
typename Engine>
208 static_assert(std::is_unsigned_v<typename Engine::result_type>,
209 "uniform_unit requires an unsigned result_type");
210 const std::uint64_t v =
static_cast<std::uint64_t
>(
eng());
213 return static_cast<double>(v >> 11) * (1.0 / 9007199254740992.0);
230template <
typename Engine>
236 const std::size_t span = hi - lo + 1;
237 std::size_t pick = lo +
static_cast<std::size_t
>(u *
static_cast<double>(span));
272template <
typename Engine = std::mt19937_64>
311 template <std::
size_t Rank>
324 template <std::
size_t Rank>
Common typedefs and tag types for the Cellular Automata module.
Master seed dispenser for stochastic CA rules.
typename Engine::result_type result_type
Result type of engine_type.
Engine for_cell(const Cell_Context< Rank > &ctx) const
Build a fresh deterministic engine from a Cell_Context.
constexpr std::uint64_t master_seed() const noexcept
Return the master seed.
Engine engine_type
Underlying engine type.
Engine for_cell(const std::size_t step, const Coord_Vec< Rank > &coord) const
Build a fresh deterministic engine for cell (step, coord).
constexpr Per_Thread_RNG(const std::uint64_t seed=0) noexcept
Build a dispenser around seed.
Engine for_thread_step(const std::size_t thread_id, const std::size_t step) const
Build an engine for a (thread, step) sub-stream.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
constexpr std::uint64_t mix_seed(const std::uint64_t a, const std::uint64_t b) noexcept
Combine two 64-bit values into a single deterministic hash.
std::array< ca_index_t, N > Coord_Vec
Default coordinate vector.
constexpr std::uint64_t thread_step_seed(const std::uint64_t master_seed, const std::size_t thread_id, const std::size_t step) noexcept
Build a deterministic seed from (master, thread_id, step).
double uniform_unit(Engine &eng)
Map a 64-bit RNG output to a uniform value in [0, 1).
constexpr std::uint64_t cell_key_from_coord(const Coord_Vec< Rank > &c) noexcept
Hash a cell coordinate into a stable 64-bit key.
std::size_t uniform_int(Engine &eng, const std::size_t lo, const std::size_t hi)
Sample a uniform integer in [lo, hi] (inclusive).
constexpr std::uint64_t splitmix64(std::uint64_t x) noexcept
64-bit SplitMix hash.
constexpr std::uint64_t cell_seed(const std::uint64_t master_seed, const std::size_t step, const Coord_Vec< Rank > &coord) noexcept
Build a deterministic per-cell seed.
Main namespace for Aleph-w library functions.
Per-cell context handed to rules that need to know "where" and "when" they are firing.
std::size_t step
Index of the step that is currently being computed (0-based).
Coord_Vec< Rank > coord
Cell coordinate inside the current frame.