RandomExtensions.Fill Method

Definition

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

Overload List

Fill(Random, Vector<Double>, ContinuousDistribution) Fills a vector with random samples from the specified distribution.
Fill(Random, Vector<Double>, DiscreteDistribution) Fills a vector with random samples from the specified distribution.
Fill(Random, Double[], ContinuousDistribution) Fills a Double array with random samples from the specified distribution.
Fill(Random, Int32[], DiscreteDistribution) Fills an Int32 array with random samples from the specified distribution.
Fill(Random, Double[], Int32, Int32) Fills a Double array with random samples from the specified distribution.
Fill(Random, Int32[], Int32, Int32) Fills an Int32 array with random samples from the specified distribution.
Fill(Random, Double[], Int32, Int32, ContinuousDistribution) Fills a Double array with random samples from the specified distribution.
Fill(Random, Int32[], Int32, Int32, DiscreteDistribution) Fills an Int32 array with random samples from the specified distribution.

RandomExtensions.Fill(Random, Vector<Double>, ContinuousDistribution)

Fills a vector with random samples from the specified distribution.
C#
public static void Fill(
	this Random random,
	Vector<double> samples,
	ContinuousDistribution distribution
)

Parameters

random  Random
A random number generator used to generate samples from the distribution.
samples  Vector<Double>
A vector.
distribution  ContinuousDistribution
A ContinuousDistribution object.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Random. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullExceptionsamples is null.

RandomExtensions.Fill(Random, Vector<Double>, DiscreteDistribution)

Fills a vector with random samples from the specified distribution.
C#
public static void Fill(
	this Random random,
	Vector<double> samples,
	DiscreteDistribution distribution
)

Parameters

random  Random
A random number generator used to generate samples from the distribution.
samples  Vector<Double>
A vector.
distribution  DiscreteDistribution
A DiscreteDistribution object.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Random. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullExceptionsamples is null.

-or-

distribution is null.

RandomExtensions.Fill(Random, Double[], ContinuousDistribution)

Fills a Double array with random samples from the specified distribution.
C#
public static void Fill(
	this Random random,
	double[] samples,
	ContinuousDistribution distribution
)

Parameters

random  Random
A random number generator used to generate samples from the distribution.
samples  Double[]
A Double array.
distribution  ContinuousDistribution
A ContinuousDistribution object.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Random. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullExceptionsamples is null.

-or-

distribution is null.

RandomExtensions.Fill(Random, Int32[], DiscreteDistribution)

Fills an Int32 array with random samples from the specified distribution.
C#
public static void Fill(
	this Random random,
	int[] samples,
	DiscreteDistribution distribution
)

Parameters

random  Random
A random number generator used to generate samples from the distribution.
samples  Int32[]
A Int32 array.
distribution  DiscreteDistribution
A DiscreteDistribution object.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Random. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullExceptionsamples is null.

-or-

distribution is null.

RandomExtensions.Fill(Random, Double[], Int32, Int32)

Fills a Double array with random samples from the specified distribution.
C#
public static void Fill(
	this Random random,
	double[] samples,
	int startIndex,
	int length
)

Parameters

random  Random
A random number generator used to generate samples from the distribution.
samples  Double[]
A Double array.
startIndex  Int32
The zero-based index at which to begin filling the samples array.
length  Int32
The number of samples to provide.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Random. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullExceptionsamples 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.

RandomExtensions.Fill(Random, Int32[], Int32, Int32)

Fills an Int32 array with random samples from the specified distribution.
C#
public static void Fill(
	this Random random,
	int[] samples,
	int startIndex,
	int length
)

Parameters

random  Random
A random number generator used to generate samples from the distribution.
samples  Int32[]
A Int32 array.
startIndex  Int32
The zero-based index at which to begin filling the samples array.
length  Int32
The number of samples to provide.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Random. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullExceptionsamples 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.

RandomExtensions.Fill(Random, Double[], Int32, Int32, ContinuousDistribution)

Fills a Double array with random samples from the specified distribution.
C#
public static void Fill(
	this Random random,
	double[] samples,
	int startIndex,
	int length,
	ContinuousDistribution distribution
)

Parameters

random  Random
A random number generator used to generate samples from the distribution.
samples  Double[]
A Double array.
startIndex  Int32
The zero-based index at which to begin filling the samples array.
length  Int32
The number of samples to provide.
distribution  ContinuousDistribution
A ContinuousDistribution object.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Random. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

If distribution is null, then a uniform distribution on the interval [0,1) is assumed.

Exceptions

ArgumentNullExceptionsamples 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.

RandomExtensions.Fill(Random, Int32[], Int32, Int32, DiscreteDistribution)

Fills an Int32 array with random samples from the specified distribution.
C#
public static void Fill(
	this Random random,
	int[] samples,
	int startIndex,
	int length,
	DiscreteDistribution distribution
)

Parameters

random  Random
A random number generator used to generate samples from the distribution.
samples  Int32[]
A Int32 array.
startIndex  Int32
The zero-based index at which to begin filling the samples array.
length  Int32
The number of samples to provide.
distribution  DiscreteDistribution
A DiscreteDistribution object.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Random. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullExceptionsamples 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