23 #ifndef EDSP_BINARY_SEQUENCE_GENERATOR_HPP 24 #define EDSP_BINARY_SEQUENCE_GENERATOR_HPP 29 namespace edsp {
namespace random {
39 template <
typename T,
typename Engine = std::mt19937>
48 generator_(Engine(static_cast<std::size_t>(std::chrono::system_clock::now().time_since_epoch().count()))),
49 distribution_(std::bernoulli_distribution(probability)) {}
56 return static_cast<value_type>(distribution_(generator_));
61 std::bernoulli_distribution distribution_;
66 #endif // EDSP_BINARY_SEQUENCE_GENERATOR_HPP value_type operator()()
Generates a boolean value according to the discrete probability function.
Definition: binary_generator.hpp:55
binary_generator(value_type probability)
Creates a binary sequence generator.
Definition: binary_generator.hpp:47
T value_type
Definition: binary_generator.hpp:41
This class implements a binary generator according to the discrete probability function.
Definition: binary_generator.hpp:40
Definition: amplifier.hpp:29