|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Adapt a regular cell rule (with empty neighborhood) to a block rule. More...
#include <tpl_ca_block_rule.H>
Public Member Functions | |
| constexpr | Cell_Rule_As_Block_Rule (Cell_Rule cr) |
Wrap cr as a block rule. | |
| template<typename State > | |
| constexpr Block_2x2< State > | operator() (const Block_2x2< State > &in) const |
| Apply the wrapped rule to every cell of the 2×2 block. | |
Private Attributes | |
| Cell_Rule | cell_ |
Adapt a regular cell rule (with empty neighborhood) to a block rule.
Wraps a RuleLike cell rule whose transition depends only on its own state and applies it independently to every cell of the block. This is the trivial bridge that makes simple per-cell updates available to any Block_Rule consumer (e.g. Margolus_Update).
The wrapped rule must be invocable as cell_rule(state) returning the next state, mirroring an "outer 0-arg" (no neighbours) form.
| Cell_Rule | wrapped cell-rule type. |
Definition at line 347 of file tpl_ca_block_rule.H.
|
inlineexplicitconstexpr |
Wrap cr as a block rule.
| [in] | cr | cell rule (consumed by move). |
| Any | exception thrown by Cell_Rule's move constructor. |
Definition at line 356 of file tpl_ca_block_rule.H.
|
inlineconstexpr |
Apply the wrapped rule to every cell of the 2×2 block.
| State | cell state type. |
| [in] | in | current 2×2 block. |
| Any | exception propagated by the wrapped cell rule. |
Definition at line 365 of file tpl_ca_block_rule.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Cell_Rule_As_Block_Rule< Cell_Rule >::cell_, and out.
|
private |
Definition at line 349 of file tpl_ca_block_rule.H.
Referenced by Aleph::CA::Cell_Rule_As_Block_Rule< Cell_Rule >::operator()().