DiscreteDistribution<T>.SampleLevel Method

Definition

Namespace: Numerics.NET.Statistics.Distributions
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0

Overload List

SampleLevel(IRandomSource) Returns the level index of a random sample from the distribution.
SampleLevel(Random) 
SampleLevel<TGenerator>(IRandomSource<TGenerator>) Returns the level index of a random sample from the distribution.

SampleLevel(IRandomSource)

Returns the level index of a random sample from the distribution.
C#
public int SampleLevel(
	IRandomSource random
)

Parameters

random  IRandomSource
A Random object that specifies the uniform random number generator that is to be used to generate the samples.

Return Value

Int32
The index of the sample in the set of items.

Remarks

This method uses the random number generator specified by random to generate a random sample from the distribution. The return values of successive calls to this method follow the statistical distribution represented by this distribution.

SampleLevel<TGenerator>(IRandomSource<TGenerator>)

Returns the level index of a random sample from the distribution.
C#
public int SampleLevel<TGenerator>(
	IRandomSource<TGenerator> random
)
where TGenerator : struct, new(), IRandomGenerator

Parameters

random  IRandomSource<TGenerator>
A Random object that specifies the uniform random number generator that is to be used to generate the samples.

Type Parameters

TGenerator
The underlying generator type of the random source, used to enable optimizations like inlining.

Return Value

Int32
The index of the sample in the set of items.

Remarks

This method uses the random number generator specified by random to generate a random sample from the distribution. The return values of successive calls to this method follow the statistical distribution represented by this distribution.

SampleLevel(Random)

C#
public int SampleLevel(
	Random random
)

Parameters

random  Random
 

Return Value

Int32

See Also