odsek 0.1.0

Lazy, pull-based composition of mathematical interval sets with open/closed endpoints, no_std-compatible.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Translate an interval set by a constant offset using `IntervalShift`.
//!
//! Run with: `cargo run --example shift`

use odsek::*;

fn main() {
    // [1, 4)
    let i = Interval::new(EndpointOC::Closed(1), EndpointOC::Open(4), ());
    let is = IntervalsSingle::new(i);

    // Shift everything by +5 → [6, 9)
    for iv in IntervalShift::new(is, 5).into_iter() {
        println!("{:?}", iv);
    }
}