Trait differential_dataflow::lattice::Lattice[][src]

pub trait Lattice: PartialOrder {
    fn join(&self, _: &Self) -> Self;
fn meet(&self, _: &Self) -> Self; fn join_assign(&mut self, other: &Self)
    where
        Self: Sized
, { ... }
fn meet_assign(&mut self, other: &Self)
    where
        Self: Sized
, { ... }
fn advance_by(&mut self, frontier: AntichainRef<'_, Self>)
    where
        Self: Sized
, { ... } }

A bounded partially ordered type supporting joins and meets.

Required methods

fn join(&self, _: &Self) -> Self[src]

The smallest element greater than or equal to both arguments.

Examples


let time1 = Product::new(3, 7);
let time2 = Product::new(4, 6);
let join = time1.join(&time2);

assert_eq!(join, Product::new(4, 7));

fn meet(&self, _: &Self) -> Self[src]

The largest element less than or equal to both arguments.

Examples


let time1 = Product::new(3, 7);
let time2 = Product::new(4, 6);
let meet = time1.meet(&time2);

assert_eq!(meet, Product::new(3, 6));
Loading content...

Provided methods

fn join_assign(&mut self, other: &Self) where
    Self: Sized
[src]

Updates self to the smallest element greater than or equal to both arguments.

Examples


let mut time1 = Product::new(3, 7);
let time2 = Product::new(4, 6);
time1.join_assign(&time2);

assert_eq!(time1, Product::new(4, 7));

fn meet_assign(&mut self, other: &Self) where
    Self: Sized
[src]

Updates self to the largest element less than or equal to both arguments.

Examples


let mut time1 = Product::new(3, 7);
let time2 = Product::new(4, 6);
time1.meet_assign(&time2);

assert_eq!(time1, Product::new(3, 6));

fn advance_by(&mut self, frontier: AntichainRef<'_, Self>) where
    Self: Sized
[src]

Advances self to the largest time indistinguishable under frontier.

This method produces the “largest” lattice element with the property that for every lattice element greater than some element of frontier, both the result and self compare identically to the lattice element. The result is the “largest” element in the sense that any other element with the same property (compares identically to times greater or equal to frontier) must be less or equal to the result.

When provided an empty frontier self is not modified.

Examples


use timely::progress::frontier::{Antichain, AntichainRef};

let time = Product::new(3, 7);
let mut advanced = Product::new(3, 7);
let frontier = Antichain::from(vec![Product::new(4, 8), Product::new(5, 3)]);
advanced.advance_by(frontier.borrow());

// `time` and `advanced` are indistinguishable to elements >= an element of `frontier`
for i in 0 .. 10 {
    for j in 0 .. 10 {
        let test = Product::new(i, j);
        // for `test` in the future of `frontier` ..
        if frontier.less_equal(&test) {
            assert_eq!(time.less_equal(&test), advanced.less_equal(&test));
        }
    }
}

assert_eq!(advanced, Product::new(4, 7));
Loading content...

Implementations on Foreign Types

impl<T1: Lattice, T2: Lattice> Lattice for Product<T1, T2>[src]

impl Lattice for Duration[src]

impl Lattice for usize[src]

impl Lattice for u128[src]

impl Lattice for u64[src]

impl Lattice for u32[src]

impl Lattice for u16[src]

impl Lattice for u8[src]

impl Lattice for isize[src]

impl Lattice for i128[src]

impl Lattice for i64[src]

impl Lattice for i32[src]

impl Lattice for i16[src]

impl Lattice for i8[src]

impl Lattice for ()[src]

impl<T: Lattice + Clone> Lattice for Antichain<T>[src]

Loading content...

Implementors

Loading content...