#interval #algebra

allen_interval_algebra

A simple package for interval algebra for more information see https://en.wikipedia.org/wiki/Allen%27s_interval_algebra

3 releases

0.1.2 Jun 2, 2023
0.1.1 Jun 2, 2023
0.1.0 Jun 2, 2023

#1145 in Math


Used in time_varying_graph

MIT/Apache

5KB
50 lines

allen_interval_algebra

Description

A basic library for interval algerbra, for more information see wikipedia

Use

Create intervals using the Interval::new(start, end) function. For comparison use the integrated function.

Main features

Test for basic interval relations:

  • precede
  • meet
  • overlaps
  • starts
  • during
  • finishes
  • equal

lib.rs:

Allen's interval algebra is a basic library for intervals and their comparison

Example

    use allen_interval_algebra::interval::Interval;

    //Create 3 intervals
    let x = Interval::new(0,10);
    let y = Interval::new(10,14);
    let z = Interval::new(15,16);

    //Test whether x interval meets z or y
    assert_eq!(x.meet(z),false);
    assert!(x.meet(y))


Dependencies

~87KB