iter_cartesian 0.1.0

A Cartesian product iterator with double-ended iteration and O(1) length queries.
Documentation
1
2
3
4
5
6
7
8
9
10
use iter_cartesian::CartesianExt;

fn main() {
    // Sample a 2D domain at 0.5s intervals.
    let samples: Vec<_> = (0..8)
        .cartesian(0..8)
        .map(|(i, j)| (i as f32 * 0.5, j as f32 * 0.5))
        .collect();
    println!("Sample points: {}", samples.len());
}