DiscreteDistribution<T>.SampleLevels Method

Fills an array with the level indexes of random samples from this DiscreteDistribution<T>.

Definition

Namespace: Numerics.NET.Statistics.Distributions
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2
C#
public void SampleLevels(
	Random random,
	int[] samples,
	int startIndex,
	int length
)

Parameters

random  Random
A Random object that specifies the uniform random number generator that is to be used to generate the samples.
samples  Int32[]
An array.
startIndex  Int32
The zero-based index at which to begin filling the samples array.
length  Int32
The number of samples to provide.

Remarks

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

Exceptions

ArgumentNullException

samples is null.

-or-

random is null.

ArgumentOutOfRangeException

startIndex is less than zero.

-or-

length is less than zero.

ArgumentException

length is greater than the number of elements from startIndex to the end of samples.

See Also