Shuffler.Shuffle Method
Definition
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
Overload List
Shuffle<T>(IList<T>) | Puts the members of a collection in random order. |
Shuffle<T>(IList<T>, Random) | Puts the members of a collection in a random order. |
Shuffle<T>(IList<T>, Int32, Int32, Random) | Puts the members of a collection in a random order. |
Shuffle<T>(IList<T>)
public static void Shuffle<T>(
IList<T> list
)
Parameters
- list IList<T>
- The list to shuffle.
Type Parameters
- T
Remarks
This function makes a list of the n numbers from min to min+n-1 in random order. The parameter list must be an array with at least n elements. The array index goes from 0 to n-1. If you want to shuffle something else than integers then use the integers in list as an index into a table of the items you want to shuffle.
Exceptions
ArgumentNullException | list is null. |
Shuffle<T>(IList<T>, Random)
public static void Shuffle<T>(
IList<T> list,
Random random
)
Parameters
- list IList<T>
- The list to shuffle.
- random Random
- A Random derived random number generator that is used to generate the random sequence.
Type Parameters
- T
Remarks
This function makes a list of the n numbers from min to min+n-1 in random order. The parameter 'this.list' must be an array with at least n elements. The array index goes from 0 to n-1. If you want to shuffle something else than integers then use the integers in list as an index into a table of the items you want to shuffle.
Exceptions
ArgumentNullException | list is null.
-or- random is null. |
Shuffle<T>(IList<T>, Int32, Int32, Random)
public static void Shuffle<T>(
IList<T> list,
int startIndex,
int length,
Random random
)
Parameters
- list IList<T>
- The list to shuffle.
- startIndex Int32
- The index of the first member that should be shuffled.
- length Int32
- The number of members that should be shuffled.
- random Random
- A Random derived random number generator that is used to generate the random sequence.
Type Parameters
- T
Remarks
This function makes a list of the n numbers from min to min+n-1 in random order. The parameter 'this.list' must be an array with at least n elements. The array index goes from 0 to n-1. If you want to shuffle something else than integers then use the integers in list as an index into a table of the items you want to shuffle.
Exceptions
ArgumentNullException | list is null.
-or- random is null. |