61#ifndef TPL_CA_MULTI_FIELD_RULE_H
62#define TPL_CA_MULTI_FIELD_RULE_H
76namespace ca_mf_rule_detail {
84template <
typename Tuple>
87template <
typename...
Fields>
90 using type = std::tuple<Neighbor_View<Fields>...>;
97template <
typename FieldsTuple>
109template <
typename R,
typename FieldsTuple>
112 {
r(
cur,
nb) } -> std::convertible_to<FieldsTuple>;
124template <
typename R,
typename FieldsTuple, std::
size_t Rank>
129 {
r(
cur,
nb, ctx) } -> std::convertible_to<FieldsTuple>;
133template <
typename R,
typename FieldsTuple, std::
size_t Rank>
152template <
typename Rule,
typename FieldsTuple, std::
size_t Rank>
158 if constexpr (
requires {
r(
cur,
nb, ctx); })
180template <std::
size_t I,
typename Inner>
199 template <
typename FieldsTuple>
213 template <
typename FieldsTuple, std::
size_t Rank>
220 if constexpr (
requires {
inner_(std::get<I>(
cur), std::get<I>(
nb), ctx); })
221 std::get<I>(
out) =
inner_(std::get<I>(
cur), std::get<I>(
nb), ctx);
size_t size_t int32_t * out
Common typedefs and tag types for the Cellular Automata module.
Adaptor: apply a mono-field rule to field I, leave the other fields unchanged.
FieldsTuple operator()(const FieldsTuple &cur, const Field_Neighbor_Views_Tuple< FieldsTuple > &nb, const Cell_Context< Rank > &ctx) const
Contextual-form invocation.
FieldsTuple operator()(const FieldsTuple &cur, const Field_Neighbor_Views_Tuple< FieldsTuple > &nb) const
Pure-form invocation.
constexpr Field_Slice_Rule(Inner inner)
Wrap a mono-field rule.
Concept: a pure multi-field rule.
Concept: a contextual multi-field rule.
Concept: any supported multi-field rule signature.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
typename ca_mf_rule_detail::neighbor_view_tuple< FieldsTuple >::type Field_Neighbor_Views_Tuple
std::tuple<Neighbor_View<F>...> for the field tuple std::tuple<F...>.
@ R
Recovered (and immune).
std::span< const T > Neighbor_View
Read-only view over a contiguous range of neighbour values.
FieldsTuple apply_multi_field_rule(const Rule &r, const FieldsTuple &cur, const Field_Neighbor_Views_Tuple< FieldsTuple > &nb, const Cell_Context< Rank > &ctx)
Invoke a multi-field rule with optional context forwarding.
Main namespace for Aleph-w library functions.
Per-cell context handed to rules that need to know "where" and "when" they are firing.
std::tuple< Neighbor_View< Fields >... > type
C++20 concepts for the Cellular Automata module.