2 releases
Uses old Rust 2015
0.1.1 | Dec 3, 2017 |
---|---|
0.1.0 | Jul 19, 2017 |
#1512 in Algorithms
90 downloads per month
19KB
219 lines
Rust crate for Gray codes
This crate provides iterators over Gray codes as well as utilities for efficiently visiting all subsets of a collection. See the rustdoc for more details and examples.
This crate is published on the https://crates.io/ repository as the "gray-codes" crate.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
lib.rs
:
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.