FoldedNormalDistribution.SampleInto Method

Definition

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

Overload List

SampleInto(Span<Double>) Fills a span with random numbers from the distribution using the default thread-safe random number generator.
SampleInto(IRandomSource, IList<Double>) Fills the provided list with random samples drawn from this distribution.
SampleInto(IRandomSource, Span<Double>) Fills a span with random numbers from the distribution.
SampleInto(Random, IList<Double>) Fills the provided list with random samples drawn from this distribution.
SampleInto(Random, Double[]) Fills a list with random numbers from the distribution.
SampleInto(Random, Span<Double>) Fills the given span with random samples drawn from this distribution.
SampleInto(IRandomSource, IList<Double>, Int32, Int32) Fills a range within a list with random samples drawn from this distribution.
SampleInto(Random, IList<Double>, Int32, Int32) Fills a range within a list with random samples drawn from this distribution.
SampleInto<TGenerator>(IRandomSource<TGenerator>, Span<Double>) Fills a span with random numbers from the distribution.
SampleInto<TGenerator>(TGenerator, IList<Double>, Int32, Int32) Fills a range within a list with random samples drawn from this distribution.
SampleInto<TGenerator>(TGenerator, IList<Double>, Int32, Int32) Fills a range within a list with random samples drawn from this distribution.

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

Fills a range within a list with random samples drawn from this distribution.
C#
public override void SampleInto<TGenerator>(
	ref TGenerator generator,
	IList<double> samples,
	int startIndex,
	int length
)
where TGenerator : struct, new(), IRandomGenerator

Parameters

generator  TGenerator
The random number generator used to generate uniform variates.
samples  IList<Double>
The destination list to receive generated values.
startIndex  Int32
The zero-based index at which to begin writing.
length  Int32
The number of samples to write.

Type Parameters

TGenerator

Remarks

If samples is an array, this method forwards to the span-based implementation for better performance.

Exceptions

ArgumentNullException

samples is null.

ArgumentOutOfRangeExceptionThrown when startIndex or length is negative.
ArgumentExceptionThrown when the specified range (startIndex + length) exceeds the bounds of samples.

See Also