Class BernoulliDist

Class Documentation

class BernoulliDist

class BernoulliDist. Wrapper to std::bernoulli_distribution

Public Types

typedef bool result_type

\breif The return type every time we call pdf, sample

Public Functions

explicit BernoulliDist(real_t p = 0.5)

Constructor.

result_type sample() const

Sample from the distribution.

result_type sample(uint_t seed) const

Sample from the distribution.

std::vector<result_type> sample_many(uint_t size) const

sample from the distribution

std::vector<result_type> sample_many(uint_t size, uint_t seed) const

sample from the distribution

inline real_t mean() const

The mean value of the distribution.

inline real_t variance() const

The STD of the distribution.

inline void reset()

Reset the underlying distribution.

void reset(real_t p)

Reset the distribution with a new p.