Random Source Extensions.Fill Without Replacement Method
Definition
Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.3.0
Overload List
| Fill | Populates the specified span with numbers chosen at random between 0 and the provided count without replacement. |
| Fill | Populates the specified span with numbers chosen at random between 0 and the provided count without replacement. |
FillWithoutReplacement(IRandomSource, Int32, Span<Int32>)
Populates the specified span with numbers chosen at random
between 0 and the provided count without replacement.
public static void FillWithoutReplacement(
this IRandomSource rng,
int count,
Span<int> destination
)Parameters
- rng IRandomSource
- count Int32
- The number of items.
- destination Span<Int32>
- The span to be filled with items.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IRandomSource. 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).FillWithoutReplacement<TGenerator>(IRandomSource<TGenerator>, Int32, Span<Int32>)
Populates the specified span with numbers chosen at random
between 0 and the provided count without replacement.
public static void FillWithoutReplacement<TGenerator>(
this IRandomSource<TGenerator> rng,
int count,
Span<int> destination
)
where TGenerator : struct, new(), IRandomGenerator
Parameters
- rng IRandomSource<TGenerator>
- count Int32
- The number of items.
- destination Span<Int32>
- The span to be filled with items.
Type Parameters
- TGenerator