Skip to main content

Module subset

Module subset 

Source
Expand description

Subsets of {0, ..., n-1} in bitmask order, with rank/unrank.

A subset is represented as its sorted member indices. Ordinal r is the bitmask whose bit i indicates membership of element i.

Structs§

SubsetIter
Iterator over all 2^n subsets of {0, ..., n-1} in bitmask order.

Functions§

subset_rank
The bitmask ordinal of subset (a list of distinct indices < n).
subset_unrank
The subset (sorted member indices) for bitmask ordinal rank over n.
subsets
Construct a subset iterator, rejecting n too large for the u128 cursor.