permutation_iterator 0.1.2

A Rust library for iterating over random permutations using O(1) (i.e. constant) space.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use permutation_iterator::RandomPairPermutor;

fn main() {
    let xs = [1, 2, 3];
    let ys = [4, 5, 6, 7, 8];

    let permutor = RandomPairPermutor::new(xs.len() as u32, ys.len() as u32);
    for (i, j) in permutor {
        println!("({}, {})", xs[i as usize], ys[j as usize]);
    }
}