35[[nodiscard]]
inline uint32_t
xorshift32(uint32_t state)
noexcept
37 state ^= state << 13U;
38 state ^= state >> 17U;
56[[nodiscard]] MAYAFLUX_API std::vector<double>
truth_table_state(
size_t arity, uint64_t rule);
68 std::span<const bool> history, std::span<const double> coefs)
noexcept;
76 std::span<const bool> history, std::span<const double> coefs)
noexcept;
112[[nodiscard]] MAYAFLUX_API
bool rising_toggle(
double input, std::span<double> coefs)
noexcept;
131[[nodiscard]] MAYAFLUX_API
bool edge_divider(
double input, std::span<double> coefs)
noexcept;
142 double probability, uint32_t seed = 0,
double threshold = 0.5);
151[[nodiscard]] MAYAFLUX_API
bool bernoulli_gate(
double input, std::span<double> coefs)
noexcept;
162 uint32_t taps, uint32_t seed = 1,
double threshold = 0.5);
171[[nodiscard]] MAYAFLUX_API
bool galois_lfsr(
double input, std::span<double> coefs)
noexcept;
184 std::span<const double> table,
double threshold = 0.5,
size_t initial = 0);
193[[nodiscard]] MAYAFLUX_API
bool state_machine(
double input, std::span<double> coefs)
noexcept;
206 size_t pulses,
size_t steps,
size_t rotation = 0);
214[[nodiscard]] MAYAFLUX_API
bool step_pattern(
double input, std::span<double> coefs)
noexcept;
236 double input,
double time, std::span<double> coefs)
noexcept;
253[[nodiscard]] MAYAFLUX_API
bool one_shot(
254 double input,
double time, std::span<double> coefs)
noexcept;
274 const std::vector<double>& inputs, std::span<double> coefs)
noexcept;
282[[nodiscard]] MAYAFLUX_API std::vector<double>
comparator_state(
double margin = 0.0);
291 const std::vector<double>& inputs, std::span<double> coefs)
noexcept;
299 const std::vector<double>& inputs, std::span<const double> coefs)
noexcept;
317 const std::vector<double>& inputs, std::span<const double> coefs)
noexcept;
329 size_t arity, uint64_t rule,
double threshold = 0.5);
339 const std::vector<double>& inputs, std::span<const double> coefs)
noexcept;
350 size_t length,
size_t tap,
double threshold = 0.5);
361 const std::vector<double>& inputs, std::span<double> coefs)
noexcept;
Core::GlobalInputConfig input
bool one_shot(double input, double time, std::span< double > coefs) noexcept
Monostable: every rise of the input opens the output for a fixed time.
bool bernoulli_gate(double input, std::span< double > coefs) noexcept
Probabilistic gate: each pulse passes with the given probability.
bool truth_table(std::span< const bool > history, std::span< const double > coefs) noexcept
Any boolean function of the last bits, as a table.
std::vector< double > state_machine_state(std::span< const double > table, double threshold, size_t initial)
Builds the array state_machine reads and writes.
std::vector< double > truth_table_state(size_t arity, uint64_t rule)
Builds the array truth_table reads.
uint32_t xorshift32(uint32_t state) noexcept
One step of the 32-bit xorshift generator.
bool comparator(const std::vector< double > &inputs, std::span< double > coefs) noexcept
Signal against signal: true once slot 0 exceeds slot 1 by the margin.
std::vector< double > signals_at_least_state(size_t k, double threshold)
Builds the array signals_at_least reads.
std::vector< double > bernoulli_gate_state(double probability, uint32_t seed, double threshold)
Builds the array bernoulli_gate reads and writes.
std::vector< double > edge_divider_state(size_t n, size_t offset, double threshold)
Builds the array edge_divider reads and writes.
bool window_comparator(const std::vector< double > &inputs, std::span< const double >) noexcept
True while slot 0 lies strictly between slot 1 and slot 2.
bool step_pattern(double input, std::span< double > coefs) noexcept
A table of bits advanced by the rises of the input.
bool count_at_least(std::span< const bool > history, std::span< const double > coefs) noexcept
True when at least k of the last n bits are set.
std::vector< double > hysteresis_gate_state(double low, double high)
Builds the array hysteresis_gate reads and writes.
std::vector< double > comparator_state(double margin)
Builds the array comparator reads and writes.
std::vector< double > galois_lfsr_state(uint32_t taps, uint32_t seed, double threshold)
Builds the array galois_lfsr reads and writes.
bool refractory_gate(double input, double time, std::span< double > coefs) noexcept
Fires while the input is high, then ignores it for a period.
std::vector< double > maximally_even_sequence(size_t pulses, size_t steps, size_t rotation)
The maximally even placement of pulses among steps, as a 0 or 1 table.
bool rising_toggle(double input, std::span< double > coefs) noexcept
Flip-flop: the output inverts on every rise of the input.
bool clocked_register(const std::vector< double > &inputs, std::span< double > coefs) noexcept
Shift register: slot 1 is sampled into it on every rise of slot 0.
std::vector< double > refractory_gate_state(double period, double threshold)
Builds the array refractory_gate reads and writes.
bool state_machine(double input, std::span< double > coefs) noexcept
Mealy machine: the state and the input bit pick the next state and the output.
bool input_truth_table(const std::vector< double > &inputs, std::span< const double > coefs) noexcept
Any boolean function of the input slots, as a table.
bool signals_at_least(const std::vector< double > &inputs, std::span< const double > coefs) noexcept
True when at least k of the input slots are high.
std::vector< double > input_truth_table_state(size_t arity, uint64_t rule, double threshold)
Builds the array input_truth_table reads.
std::vector< double > clocked_register_state(size_t length, size_t tap, double threshold)
Builds the array clocked_register reads and writes.
std::vector< double > set_reset_latch_state(double threshold)
Builds the array set_reset_latch reads and writes.
std::vector< double > one_shot_state(double duration, double threshold)
Builds the array one_shot reads and writes.
bool galois_lfsr(double input, std::span< double > coefs) noexcept
Linear feedback shift register clocked by the rises of the input.
bool set_reset_latch(const std::vector< double > &inputs, std::span< double > coefs) noexcept
Memory cell: slot 0 sets it, slot 1 resets it, reset wins.
bool edge_divider(double input, std::span< double > coefs) noexcept
Gate divider: the input passes only during every n-th pulse.
bool hysteresis_gate(double input, std::span< double > coefs) noexcept
Schmitt trigger: engages above high, releases below low, holds between.
std::vector< double > rising_toggle_state(double threshold)
Builds the array rising_toggle reads and writes.