DiscreteDistribution<T>.SampleLevels Method

Definition

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

Overload List

SampleLevels(IRandomSource, Span<Int32>) Fills a span with the level indexes of random samples from this DiscreteDistribution<T>.
SampleLevels(Random, Span<Int32>) Fills a span with the level indexes of random samples from this DiscreteDistribution<T>.
SampleLevels<TGenerator>(TGenerator, Span<Int32>) Fills a span with the level indexes of random samples from this DiscreteDistribution<T>.
SampleLevels<TGenerator>(IRandomSource<TGenerator>, Span<Int32>) Fills a span with the level indexes of random samples from this DiscreteDistribution<T>.

SampleLevels<TGenerator>(TGenerator, Span<Int32>)

Fills a span with the level indexes of random samples from this DiscreteDistribution<T>.
C#
public void SampleLevels<TGenerator>(
	ref TGenerator generator,
	Span<int> samples
)
where TGenerator : struct, new(), IRandomGenerator

Parameters

generator  TGenerator
 
samples  Span<Int32>
An array.

Type Parameters

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

Remarks

This method fills a block of length elements of samples, starting at index startIndex with random samples from the distribution.

Exceptions

ArgumentNullException

random is null.

SampleLevels(IRandomSource, Span<Int32>)

Fills a span with the level indexes of random samples from this DiscreteDistribution<T>.
C#
public void SampleLevels(
	IRandomSource random,
	Span<int> samples
)

Parameters

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

Remarks

This method fills a block of length elements of samples, starting at index startIndex with random samples from the distribution.

Exceptions

ArgumentNullException

random is null.

SampleLevels<TGenerator>(IRandomSource<TGenerator>, Span<Int32>)

Fills a span with the level indexes of random samples from this DiscreteDistribution<T>.
C#
public void SampleLevels<TGenerator>(
	IRandomSource<TGenerator> random,
	Span<int> samples
)
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.
samples  Span<Int32>
An array.

Type Parameters

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

Remarks

This method fills a block of length elements of samples, starting at index startIndex with random samples from the distribution.

Exceptions

ArgumentNullException

random is null.

SampleLevels(Random, Span<Int32>)

Fills a span with the level indexes of random samples from this DiscreteDistribution<T>.
C#
public void SampleLevels(
	Random random,
	Span<int> samples
)

Parameters

random  Random
A Random object that specifies the uniform random number generator that is to be used to generate the samples.
samples  Span<Int32>
An array.

Remarks

This method fills a block of length elements of samples, starting at index startIndex with random samples from the distribution.

Exceptions

ArgumentNullException

random is null.

See Also