ContinuousDistribution.SampleInto Method

Definition

Namespace: Extreme.Statistics.Distributions
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

SampleInto(Random, IList<Double>) Fills a list with random numbers from the distribution.
SampleInto(Random, IList<Double>, Int32, Int32) Fills part of a list with random numbers from the distribution.

SampleInto(Random, IList<Double>)

Fills a list with random numbers from the distribution.
C#
public void SampleInto(
	Random random,
	IList<double> samples
)

Parameters

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

Remarks

This method fills the vector specified by samples, with random samples from the distribution.

Exceptions

ArgumentNullExceptionsamples is null.
-or-
random is null.

SampleInto(Random, IList<Double>, Int32, Int32)

Fills part of a list with random numbers from the distribution.
C#
public virtual void SampleInto(
	Random random,
	IList<double> 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  IList<Double>
A IList<Double>.
startIndex  Int32
The zero-based index at which to begin filling the list.
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

ArgumentNullExceptionsamples is null.
-or-
random is null.
ArgumentOutOfRangeExceptionstartIndex is less than zero.

-or-

length is less than zero.

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

See Also