Expand description
Gray code iterators and related utilities.
A Gray code is a reordering of the integers such that adjacent codes differ by exactly one bit.
The GrayCode{8,16,32,64}
structs provide iterators over binary
reflected Gray codes in various unsigned integer sizes as well as
direct conversions to and from the codes. The Subsets
struct
provides a convenient way to iterate over subsets of a slice. The
InclusionExclusion
struct provides a building block for visiting
all subsets more efficiently.
Structs§
- Gray
Code8 - Iterator over binary reflected Gray codes as u8 values
- Gray
Code16 - Iterator over binary reflected Gray codes as u16 values
- Gray
Code32 - Iterator over binary reflected Gray codes as u32 values
- Gray
Code64 - Iterator over binary reflected Gray codes as u64 values
- Inclusion
Exclusion - Iterator yielding
SetMutation
s that can be used to efficiently visit all subsets of n items - Subsets
- Iterator yielding subsets of a slice
Enums§
- SetMutation
- Set mutation operations.
Type Aliases§
- VecSubsets
- Alias for iterating over
Vec
-valued subsets of a slice.