A Bernoulli distribution, where each sample returns either
or .- Namespace
- RandN
.Distributions - Interfaces
- I
Portable Distribution <bool> - IDistribution
<bool> - IDistribution
- I
- Base Types
- object
- ValueType
Syntax
public readonly struct Bernoulli : ValueType, IPortableDistribution<bool>, IDistribution<bool>Methods
| Name | Return Value | Summary |
|---|---|---|
| FromInverse | Bernoulli | Creates a new Bernoulli distribution, with a probability of numerator / 2^64. static |
| FromP | Bernoulli | Creates a new Bernoulli distribution with a probability of p. static |
| FromRatio | Bernoulli | Creates a new Bernoulli distribution, with a probability of numerator / denominator. static |
| Sample | bool | Samples a value from rng, blocking until a suitable value is returned. |
| TrySample | bool | Attempts to sample a value from rng once, returning false if the value returned is not suitable. |