Skip to main content

Module combination

Module combination 

Source
Expand description

k-combinations of {0, ..., n-1} in lexicographic order, with rank/unrank.

A combination is a strictly ascending list of k indices. Rank and unrank agree with the iterator’s lexicographic order.

Structs§

CombinationIter
Iterator over k-combinations of {0, ..., n-1} in lexicographic order.

Functions§

combination_rank
The lexicographic rank of combo among the k-combinations of n.
combination_unrank
The k-combination of n at lexicographic ordinal rank.
combinations
Construct a combination iterator. k must not exceed n.