"

Uniform.

Uniform.Int32 Struct

Summary

A uniform distribution of type int.
Namespace
RandN.Distributions
Interfaces
Base Types
  • object
  • ValueType

Syntax

public readonly struct Uniform.Int32 : ValueType, IPortableDistribution<int>, IDistribution<int>

Methods

NameValueSummary
Create(int, int)Uniform.Int32
Creates a Uniform.Int32 with an exclusive upper bound. Should not be used directly; instead, use New(int, int).
static
CreateInclusive(int, int)Uniform.Int32
Creates a Uniform.Int32 with an exclusive lower bound. Should not be used directly; instead, use NewInclusive(int, int).
static
Sample<TRng>(TRng)int
Samples a value from rng, blocking until a suitable value is returned.
TrySample<TRng>(TRng, int)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

NameValueSummary
Select<int, TResult>(Func<int, TResult>)IDistribution<TResult>
Transforms a distribution by mapping its values using the selector provided. This method implements the "map" operator from functional programming principles.
SelectMany<int, TIntermediate, TResult>(Func<int, IDistribution<TIntermediate>>, Func<int, TIntermediate, TResult>)IDistribution<TResult>
Transforms a distribution by mapping values using the selector provided to produce a new distribution, which is then sampled from.
SelectMany<int, TResult>(Func<int, IDistribution<TResult>>)IDistribution<TResult>
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.