Enumerates the indexes of all combinations with replacement
of the specified length from a set of the specified size.
Namespace:
Extreme.Mathematics
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static IEnumerable<int[]> CombinationsWithReplacement(
int count,
int length,
int[] result
)
Public Shared Function CombinationsWithReplacement (
count As Integer,
length As Integer,
result As Integer()
) As IEnumerable(Of Integer())
public:
static IEnumerable<array<int>^>^ CombinationsWithReplacement(
int count,
int length,
array<int>^ result
)
static member CombinationsWithReplacement :
count : int *
length : int *
result : int[] -> IEnumerable<int[]>
Parameters
- count
- Type: SystemInt32
The size of the set to draw combinations from. - length
- Type: SystemInt32
The length of the combinations. - result
- Type: SystemInt32
An array that is to hold the result.
Return Value
Type:
IEnumerableInt32A sequence of integer arrays that contain the indexes of
all combinations with replacement of
length elements
from a set of size
count.
The indexes are returned each time in the same array,
result. Its elements should not be modified.
If they are modified, the results are unpredictable.
Reference