56#ifndef TPL_CA_CONCEPTS_H
57#define TPL_CA_CONCEPTS_H
90template <
typename C, std::
size_t N>
91concept Coord = std::regular<C>
and requires(C c, std::size_t i) {
92 { c[i] } -> std::convertible_to<ca_index_t>;
93 { C{}.size() } -> std::convertible_to<std::size_t>;
94}
and (std::tuple_size<C>::value ==
N);
114 typename L::state_type;
115 typename L::coord_type;
117 {
clat.dimension() } -> std::convertible_to<std::size_t>;
118 {
clat.size(d) } -> std::convertible_to<std::size_t>;
119 {
clat.at(c) } -> std::convertible_to<typename L::state_type>;
146 typename H::coord_type;
147 { H::rank_v } -> std::convertible_to<std::size_t>;
148 { H::size_v } -> std::convertible_to<std::size_t>;
150 and requires(
const H &
h,
const typename H::coord_type ¢er) {
151 {
h.radius() } -> std::convertible_to<std::size_t>;
152 {
h.size() } -> std::convertible_to<std::size_t>;
153 h.for_each_offset(center, [](
const auto &) {});
165template <
typename R,
typename L>
169 {
r(s, v) } -> std::convertible_to<typename L::state_type>;
184template <
typename R,
typename L>
187and requires(
const R &
r,
const typename L::state_type &s,
190 {
r(s, v, ctx) } -> std::convertible_to<typename L::state_type>;
202template <
typename R,
typename L>
224template <
typename Rule,
typename State, std::
size_t Rank>
230 if constexpr (
requires {
r(s, v, ctx); })
256template <
typename Lattice>
260 lat.at_axial(std::declval<Hex_Axial>());
266template <
typename Lattice>
270 lat.at_tri(std::declval<Tri_Coord>());
Common typedefs and tag types for the Cellular Automata module.
Pure local transition function (Phase 0–7 signature).
A type usable as the value stored inside a cell.
Context-aware local transition function (Phase 8).
A coordinate type with N integral components.
Detect whether a lattice exposes a refresh_halo() method (the hallmark of a Ghost_Lattice or any othe...
Detect whether a lattice exposes the hexagonal-grid query interface (rows(), cols(),...
Storage + topology that carries the cell values.
Connectivity pattern around a coordinate.
Local transition function (any supported signature).
Detect whether a lattice exposes the triangular-grid query interface (rows(), cols(),...
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
@ R
Recovered (and immune).
std::span< const T > Neighbor_View
Read-only view over a contiguous range of neighbour values.
State apply_rule(const Rule &r, const State &s, Neighbor_View< State > v, const Cell_Context< Rank > &ctx)
Invoke a rule, optionally forwarding the per-cell context.
Main namespace for Aleph-w library functions.
and
Check uniqueness with explicit hash + equality functors.
Per-cell context handed to rules that need to know "where" and "when" they are firing.
Axial integer coordinates (q, r) of a hex cell.
Coordinates of a triangular cell as (i, j) integers.