template<
typename Engine = std::mt19937_64>
class Aleph::CA::Per_Thread_RNG< Engine >
Master seed dispenser for stochastic CA rules.
Per_Thread_RNG does not own any RNG state: it is a pure factory that builds a fresh deterministic engine on demand from a master seed and either a per-cell context or a per-thread descriptor. This makes it cheap to copy, share between threads (no synchronisation required) and to compose with the Phase 5 parallel engine without serialisation hazards.
Typical usage inside a contextual rule:
double p; std::uint64_t master;
template <typename State, std::size_t Rank>
auto eng =
rng.for_cell(ctx);
}
};
Master seed dispenser for stochastic CA rules.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
std::span< const T > Neighbor_View
Read-only view over a contiguous range of neighbour values.
double uniform_unit(Engine &eng)
Map a 64-bit RNG output to a uniform value in [0, 1).
void next()
Advance all underlying iterators (bounds-checked).
Per-cell context handed to rules that need to know "where" and "when" they are firing.
- Template Parameters
-
| Engine | PRNG engine type. Defaults to std::mt19937_64 for its 64-bit output and good statistical quality. Any engine whose result_type is unsigned and at least 53 bits wide works. |
Definition at line 273 of file ca-rng.H.
template<std::size_t Rank>
Build a fresh deterministic engine for cell (step, coord).
The returned engine state depends only on (master_, step, coord), so two calls with the same arguments — possibly from different threads — produce identical streams.
- Template Parameters
-
| Rank | coordinate rank (deduced). |
- Parameters
-
| [in] | step | step index being evaluated. |
| [in] | coord | cell coordinate. |
- Returns
- engine seeded with
cell_seed(master_, step, coord).
- Exceptions
-
| Any | exception thrown by Engine's constructor. |
Definition at line 312 of file ca-rng.H.
References Aleph::blossom_maximum_cardinality_matching(), and Aleph::CA::Per_Thread_RNG< Engine >::master_.