eDSP  0.0.1
A cross-platform DSP library written in C++.
Public Types | Public Member Functions | List of all members
edsp::random::binary_generator< T, Engine > Class Template Reference

This class implements a binary generator according to the discrete probability function. More...

#include <binary_generator.hpp>

Public Types

using value_type = T
 

Public Member Functions

 binary_generator (value_type probability)
 Creates a binary sequence generator. More...
 
value_type operator() ()
 Generates a boolean value according to the discrete probability function. More...
 

Detailed Description

template<typename T, typename Engine = std::mt19937>
class edsp::random::binary_generator< T, Engine >

This class implements a binary generator according to the discrete probability function.

This function uses a Bernoulli distribution internally.

See also
std::bernoulli_distribution

Member Typedef Documentation

◆ value_type

template<typename T , typename Engine = std::mt19937>
using edsp::random::binary_generator< T, Engine >::value_type = T

Constructor & Destructor Documentation

◆ binary_generator()

template<typename T , typename Engine = std::mt19937>
edsp::random::binary_generator< T, Engine >::binary_generator ( value_type  probability)
inlineexplicit

Creates a binary sequence generator.

Parameters
probabilityThe p distribution parameter (probability of generating true)

Member Function Documentation

◆ operator()()

template<typename T , typename Engine = std::mt19937>
value_type edsp::random::binary_generator< T, Engine >::operator() ( )
inline

Generates a boolean value according to the discrete probability function.

Returns
The generated boolean value.

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