A distribution containing a single value.
- Namespace
- RandN
.Distributions - Interfaces
- Base Types
- object
Syntax
public sealed class Singleton<T> : IPortableDistribution<T>, IDistribution<T>
Type Parameters
Name | Description |
---|---|
T | The type of the value. |
Methods
Name | Return Value | Summary |
---|---|---|
Sample | T | 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. If is returned, the value of result is unspecified. |
Extension Methods
Name | Value | Summary | ||||||
---|---|---|---|---|---|---|---|---|
Select | IDistribution Transforms a distribution by mapping its values using the selector provided. This method implements the "map" operator from functional programming principles. SelectMany | IDistribution | Transforms a distribution by mapping values using the selector provided to produce a new distribution, which is then sampled from. SelectMany | IDistribution | Transforms a distribution by mapping values using the selector provided to produce a new distribution, which is then sampled from. This method implements the "bind" operator from functional programming principles. |