Method Combinations
- Namespace
- Gamelogic.Extensions.Algorithms
- Assembly
- Gamelogic.Extensions.dll
Combinations<T>(IEnumerable<T>, int)
Generates all combinations of m elements selected from the list.
public static IEnumerable<T[]> Combinations<T>(this IEnumerable<T> list, int m)
Parameters
list
IEnumerable<T>The list to select from.
m
intThe number of elements in each combination.
Returns
- IEnumerable<T[]>
IEnumerable<T[]>.
Type Parameters
T
The type of elements in the list.
Exceptions
- ArgumentOutOfRangeException
m;must be nonnegative or m;must be smaller than n
Combinations<T>(int, int, Func<int[], T>)
public static IEnumerable<T> Combinations<T>(int m, int n, Func<int[], T> select)
Parameters
Returns
- IEnumerable<T>
Type Parameters
T