Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
tpl_ca_multi_field_engine.H File Reference

Phase 14 synchronous double-buffered engine for multi-field cellular automata. More...

#include <array>
#include <cstddef>
#include <functional>
#include <span>
#include <tuple>
#include <type_traits>
#include <utility>
#include <ca-traits.H>
#include <tpl_ca_concepts.H>
#include <tpl_ca_multi_field_lattice.H>
#include <tpl_ca_multi_field_rule.H>
#include <tpl_ca_neighborhood.H>
Include dependency graph for tpl_ca_multi_field_engine.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Aleph::CA::Multi_Field_Engine< Lattice, Rule, Neighborhood >
 Synchronous double-buffered engine for multi-field lattices. More...
 

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 
namespace  Aleph::CA
 
namespace  Aleph::CA::ca_mf_engine_detail
 

Functions

template<typename Lattice , typename Neighborhood , typename Buffers , std::size_t... I>
auto Aleph::CA::ca_mf_engine_detail::build_views (const Lattice &lat, const Neighborhood &nh, const typename Lattice::coord_type &center, Buffers &bufs, std::index_sequence< I... >)
 Recurse over the Field_Indices and gather one Neighbor_View per field.
 

Detailed Description

Phase 14 synchronous double-buffered engine for multi-field cellular automata.

Multi_Field_Engine<Lattice, Rule, Neighborhood> is the multi-field twin of Synchronous_Engine: it owns a current and a next Multi_Field_Lattice (with O(1) per-field swap when SoA), gathers per-field neighbour values into stack buffers, calls the Multi_Field_Rule, and writes the resulting tuple of new field values into the next-buffer. Buffers are swapped at the end of every step.

Design constraints:

  • The multi-field path is fully synchronous and double-buffered (the simplest, safest update). The reusable update-scheme strategies of Phase 13 stay on the mono-field path.
  • Per-field neighbour buffers live on the stack: their size is Neighborhood::size_v, fixed at compile time. No heap involvement inside step().
  • The rule is invoked via apply_multi_field_rule, so contextual multi-field rules (Phase 8 RNG style) are accepted transparently.
Author
Leandro Rabindranath Leon

Definition in file tpl_ca_multi_field_engine.H.