Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::CA::BBM_Rule Class Reference

Fredkin–Toffoli Billiard Ball Machine block rule. More...

#include <tpl_ca_block_rule.H>

Public Member Functions

template<typename State >
constexpr Block_2x2< State > operator() (const Block_2x2< State > &in) const noexcept
 Apply the BBM block rule.
 

Detailed Description

Fredkin–Toffoli Billiard Ball Machine block rule.

Specification (Margolus 1984): the block's next state is computed by counting alive cells:

  • 1 alive → swap to the diagonally-opposite corner (the ball moves diagonally through the 2×2 block).
  • 2 alive on the same diagonal → swap to the other diagonal (head-on collision: balls leave at right angles).
  • Other configurations → leave the block unchanged.

The rule is its own inverse on every input pattern, so the associated Margolus CA is reversible and conserves the number of alive cells (particles).

Definition at line 185 of file tpl_ca_block_rule.H.

Member Function Documentation

◆ operator()()

template<typename State >
constexpr Block_2x2< State > Aleph::CA::BBM_Rule::operator() ( const Block_2x2< State > &  in) const
inlineconstexprnoexcept

Apply the BBM block rule.

Template Parameters
Statebinary cell state.
Parameters
[in]incurrent 2×2 block.
Returns
next 2×2 block.
Exceptions
Thisfunction does not throw.

Definition at line 195 of file tpl_ca_block_rule.H.

References Aleph::and, Aleph::blossom_maximum_cardinality_matching(), and out.


The documentation for this class was generated from the following file: