Random Extensions.Fill Method
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2
Overload List
Fill( | Fills a vector with random samples from the specified distribution. |
Fill( | Fills a vector with random samples from the specified distribution. |
Fill( | Fills a Double array with random samples from the specified distribution. |
Fill( | Fills an Int32 array with random samples from the specified distribution. |
Fill( | Fills a Double array with random samples from the specified distribution. |
Fill( | Fills an Int32 array with random samples from the specified distribution. |
Fill( | Fills a Double array with random samples from the specified distribution. |
Fill( | Fills an Int32 array with random samples from the specified distribution. |
Fill(Random, Vector<Double>, ContinuousDistribution)
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
Argument | samples is null. |
Fill(Random, Vector<Double>, DiscreteDistribution)
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
Argument | samples is null. -or- distribution is null. |
Fill(Random, Double[], ContinuousDistribution)
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
Argument | samples is null. -or- distribution is null. |
Fill(Random, Int32[], DiscreteDistribution)
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
Argument | samples is null. -or- distribution is null. |
Fill(Random, Double[], Int32, Int32)
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
Argument | samples is null. |
Argument | startIndex is less than zero. -or- length is less than zero. |
Argument | length is greater than the number of elements from startIndex to the end of samples. |
Fill(Random, Int32[], Int32, Int32)
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
Argument | samples is null. |
Argument | startIndex is less than zero. -or- length is less than zero. |
Argument | length is greater than the number of elements from startIndex to the end of samples. |
Fill(Random, Double[], Int32, Int32, ContinuousDistribution)
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
Argument | samples is null. |
Argument | startIndex is less than zero. -or- length is less than zero. |
Argument | length is greater than the number of elements from startIndex to the end of samples. |
Fill(Random, Int32[], Int32, Int32, DiscreteDistribution)
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
Argument | samples is null. |
Argument | startIndex is less than zero. -or- length is less than zero. |
Argument | length is greater than the number of elements from startIndex to the end of samples. |