new Combinations(elements, maximumCombinationSize)
Construct the combinations.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
elements |
Array | ||
maximumCombinationSize |
Number | 0 |
Methods
-
getCombinations(size)
-
Get combinations of given size.
Parameters:
Name Type Description sizeNumber -
getElements()
-
Get the elements.
Returns:
- Type
- Array
-
getLargestCombinationSize()
-
Get the size of the largest compatible combination.
Returns:
- Type
- Number
-
getLargestCombinationWithElements(elements)
-
Get the largest combination that contains the given smaller combination.
Parameters:
Name Type Description elementsArray Returns:
- Type
- Array
-
removeElement(element)
-
Remove the given element and update combinations.
Parameters:
Name Type Description elementObject -
removeElements(combination)
-
Remove a set of elements.
Parameters:
Name Type Description combinationArray