Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::CA::History_Rule< Depth, F > Class Template Reference

Rule adapter for History_Cell<State, Depth>. More...

#include <tpl_ca_continuous_rules.H>

Public Member Functions

 History_Rule (F func)
 Construct a history rule from a functor.
 
template<typename State >
History_Cell< State, Depth > operator() (const History_Cell< State, Depth > &current, Neighbor_View< History_Cell< State, Depth > > neighbours) const
 Compute the next history-bearing cell state.
 

Private Attributes

F f_
 

Detailed Description

template<std::size_t Depth, typename F>
class Aleph::CA::History_Rule< Depth, F >

Rule adapter for History_Cell<State, Depth>.

The wrapped functor can be written in one of three convenient forms:

  • F(const History_Cell<State, Depth>&, Neighbor_View<Cell>) -> State
  • F(State current, const History_Cell<State, Depth>&, Neighbor_View<Cell>) -> State
  • F(State current, State previous) -> State

The adapter pushes the returned base value into the cell ring and returns the updated History_Cell. A functor that already returns a full History_Cell with signature F(const Cell&, Neighbor_View<Cell>) -> Cell is also accepted.

Template Parameters
Depthnumber of historical slots retained per cell.
Fwrapped transition functor.

Definition at line 769 of file tpl_ca_continuous_rules.H.

Constructor & Destructor Documentation

◆ History_Rule()

template<std::size_t Depth, typename F >
Aleph::CA::History_Rule< Depth, F >::History_Rule ( F  func)
inlineexplicit

Construct a history rule from a functor.

Parameters
[in]functransition functor.
Exceptions
Anyexception thrown while moving/copying func.

Definition at line 781 of file tpl_ca_continuous_rules.H.

Member Function Documentation

◆ operator()()

template<std::size_t Depth, typename F >
template<typename State >
History_Cell< State, Depth > Aleph::CA::History_Rule< Depth, F >::operator() ( const History_Cell< State, Depth > &  current,
Neighbor_View< History_Cell< State, Depth > >  neighbours 
) const
inline

Compute the next history-bearing cell state.

Template Parameters
Statebase value stored in the history.
Parameters
[in]currentcurrent history cell.
[in]neighboursneighbour history cells.
Returns
updated history cell.
Exceptions
Anyexception thrown by the wrapped functor.

Definition at line 792 of file tpl_ca_continuous_rules.H.

References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::History_Cell< State, Depth >::current(), Aleph::CA::History_Rule< Depth, F >::f_, Aleph::next(), Aleph::CA::History_Cell< State, Depth >::previous(), and Aleph::CA::History_Cell< State, Depth >::push().

Member Data Documentation

◆ f_

template<std::size_t Depth, typename F >
F Aleph::CA::History_Rule< Depth, F >::f_
private

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