permutator-0.1.4 has been yanked.
This crate provide generic cartesian product iterator, combination iterator, and permutation iterator.
Three main functionalities
- Cartesian product
- Combination
- Permutation
Two different style on every functionality
This crate provide two implementation style
- Iterator style
- Callback function style
Easy share result
- Every function can take Rc<RefCell<>> to store result.
- An iterator that return owned value.
- Every callback style function can take Arc<RwLock<>> to store result.
Easy usage
Two built-in traits that add combination and permutation functionality to both Vec and slice.
Unreach raw performance with unsafe
Every callback style function can take raw mutable pointer to store result.
Example
- Getting k-permutation where k is 3 and n is 5.
use ;
let mut data = &;
let mut counter = 1;
data.combination.for_each;
- Cartesian product of set of 3, 4, and 5 respectively
use ;
let mut domains : &= &;
println!;
new.into_iter.for_each;
println!;
cartesian_product;