absl::bernoulli_distribution

A drop in replacement for std::bernoulli_distribution.

Synopsis

Declared in <absl/random/bernoulli_distribution.h>

class bernoulli_distribution;

Description

It guarantees that (given a perfect UniformRandomBitGenerator) the acceptance probability is exactly equal to the given double.

The implementation assumes that double is IEEE754.

Types

NameDescription
param_type The parameter set of the distribution.

Type Aliases

NameDescription
result_type The type of the values produced by the distribution.

Member Functions

NameDescription
bernoulli_distribution [constructor]Constructors
max Returns the largest value the distribution can produce.
min Returns the smallest value the distribution can produce.
operator() Function call operators
p Returns the acceptance probability.
param param overloads
reset Resets the internal state of the distribution.

Friends

NameDescription
absl::operator!=Compares two distributions for inequality.
absl::operator==Compares two distributions for equality.