Shuffler Class

Contains methods for shuffling (randomizing) the members of a collection.

Definition

Namespace: Numerics.NET.Random
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0
C#
public static class Shuffler
Inheritance
Object  →  Shuffler

Remarks

Use the Shuffler class to shuffle the elements of a collection into a random order. This class has one static method, Shuffle, which is overloaded. The first parameter is an ICollection object. The optional second argument is the random number generator used to randomize the elements.

You can enumerate elements of a collection directly using the RandomEnumerator<T> class.

Methods

Shuffle<T>(IList<T>) Puts the members of a collection in random order.
Shuffle<T>(T[]) Puts the members of an array in random order.
Shuffle<T>(Span<T>) Puts the elements of a span in random order.
Shuffle<T>(IList<T>, Random) Puts the members of a collection in a random order.
Shuffle<T>(T[], Random) Puts the members of an array in a random order.
Shuffle<T>(Span<T>, Random) Puts the elements of a span in a random order.
Shuffle<T>(IList<T>, Int32, Int32, Random) Puts the members of a collection in a random order.
Shuffle<T>(T[], Int32, Int32, Random) Puts the members of an array in a random order.

See Also