Enumerates the indexes of all combinations with replacement
of the specified length from a list of items.
Namespace:
Extreme.Mathematics
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static IEnumerable<T[]> CombinationsWithReplacement<T>(
IList<T> items,
int length
)
Public Shared Function CombinationsWithReplacement(Of T) (
items As IList(Of T),
length As Integer
) As IEnumerable(Of T())
public:
generic<typename T>
static IEnumerable<array<T>^>^ CombinationsWithReplacement(
IList<T>^ items,
int length
)
static member CombinationsWithReplacement :
items : IList<'T> *
length : int -> IEnumerable<'T[]>
Parameters
- items
- Type: System.Collections.GenericIListT
A list of items. - length
- Type: SystemInt32
The length of the combinations.
Type Parameters
- T
Return Value
Type:
IEnumerableTA sequence of integer arrays that contain the indexes of
all combinations with replacement of
length elements
from
items.
Reference