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

Name

Description

param_type

The parameter set of the distribution.

Type Aliases

Name

Description

result_type

The type of the values produced by the distribution.

Member Functions

Name

Description

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

Name

Description

absl::operator!=

Compares two distributions for inequality.

absl::operator==

Compares two distributions for equality.

Created with MrDocs