RandomExtensions.Fill Method

Definition

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

Overload List

Fill(Random, IList<Double>) Fills a Double array with random numbers.
Fill(Random, IList<Int32>) Fills an Int32 array with random numbers.
Fill(Random, IList<Double>, Int32, Int32) Fills a Double array with random numbers.
Fill(Random, IList<Int32>, Int32, Int32) Fills an Int32 array with random numbers.

Fill(Random, IList<Double>)

Fills a Double array with random numbers.
C#
public static void Fill(
	this Random random,
	IList<double> samples
)

Parameters

random  Random
A random number generator used to generate the samples.
samples  IList<Double>
A Double array.

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.

Fill(Random, IList<Int32>)

Fills an Int32 array with random numbers.
C#
public static void Fill(
	this Random random,
	IList<int> samples
)

Parameters

random  Random
A random number generator used to generate the samples.
samples  IList<Int32>
A Int32 array.

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.

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

Fills a Double array with random numbers.
C#
public static void Fill(
	this Random random,
	IList<double> samples,
	int startIndex,
	int length
)

Parameters

random  Random
A random number generator used to generate the samples.
samples  IList<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.

Fill(Random, IList<Int32>, Int32, Int32)

Fills an Int32 array with random numbers.
C#
public static void Fill(
	this Random random,
	IList<int> samples,
	int startIndex,
	int length
)

Parameters

random  Random
A random number generator used to generate the samples.
samples  IList<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.

See Also