A gate simulation implementation of gate_simulation_func. More...
Public Member Functions | |
boost::dynamic_bitset & | operator() (const gate &g, boost::dynamic_bitset<> &input) const |
Simulation for a single gate g . More... | |
A gate simulation implementation of gate_simulation_func.
This functor performs simulation on a boost::dynamic_bitset<> for Toffoli, Fredkin, and Peres gates for binary values only.
When adding new simulation functors, you can make use of this one, for example when extending the gate library. Note, that you do not have to derive from this class for this purpose, but can use the following:
boost::dynamic_bitset& operator() | ( | const gate & | g, |
boost::dynamic_bitset<> & | input | ||
) | const |
Simulation for a single gate g
.
This operator performs simulation for a single gate and is called by simple_simulation.
Important: The return value always has to be input
, and the operator should modify input
directly.
g | The gate to be simulated |
input | An input pattern |
input