Documentation
¶
Overview ¶
Package comb contains combinatorics functions
Index ¶
- func CartesianProduct[T any](domains ...[]T) iter.Seq2[uint64, []T]
- func Combinations[T any](items []T, k int) iter.Seq2[uint64, []T]
- func Factorial(n uint64) uint64
- func Permutations[T any](items []T) iter.Seq2[uint64, []T]
- func RangeCartesianProduct[T any](start, end uint64, domains ...[]T) iter.Seq2[uint64, []T]
- func RangeCombinations[T any](start, end uint64, items []T, k int) iter.Seq2[uint64, []T]
- func RangePermutations[T any](start, end uint64, items []T) iter.Seq2[uint64, []T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CartesianProduct ¶
CartesianProduct creates an iterator for the Cartesian product of the given domains
func Combinations ¶ added in v0.3.32
Combinations generates the combinations of items taken k at a time in lexicographic order.
func Permutations ¶
Permutations function creates an iterator for all possible permutations in lexicographic order This uses the Factoradic System to compute the Permutation based on the index
func RangeCartesianProduct ¶
RangeCartesianProduct creates an iterator for the Cartesian product of the given domains from index [start, end)
func RangeCombinations ¶ added in v0.3.32
RangeCombinations generates the combinations of items taken k at a time in lexicographic order for the given range [start, end).
Types ¶
This section is empty.