Trait alga::general::Lattice

source ·
pub trait Lattice: MeetSemilattice + JoinSemilattice + PartialOrd {
    // Provided methods
    fn meet_join(&self, other: &Self) -> (Self, Self) { ... }
    fn partial_min<'a>(&'a self, other: &'a Self) -> Option<&'a Self> { ... }
    fn partial_max<'a>(&'a self, other: &'a Self) -> Option<&'a Self> { ... }
    fn partial_sort2<'a>(
        &'a self,
        other: &'a Self
    ) -> Option<(&'a Self, &'a Self)> { ... }
    fn partial_clamp<'a>(
        &'a self,
        min: &'a Self,
        max: &'a Self
    ) -> Option<&'a Self> { ... }
}
Expand description

Partially orderable sets where every two elements have a supremum and infimum.

Provided Methods§

source

fn meet_join(&self, other: &Self) -> (Self, Self)

Returns the infimum and the supremum simultaneously.

source

fn partial_min<'a>(&'a self, other: &'a Self) -> Option<&'a Self>

Return the minimum of self and other if they are comparable.

source

fn partial_max<'a>(&'a self, other: &'a Self) -> Option<&'a Self>

Return the maximum of self and other if they are comparable.

source

fn partial_sort2<'a>(&'a self, other: &'a Self) -> Option<(&'a Self, &'a Self)>

Sorts two values in increasing order using a partial ordering.

source

fn partial_clamp<'a>(&'a self, min: &'a Self, max: &'a Self) -> Option<&'a Self>

Clamp value between min and max. Returns None if value is not comparable to min or max.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Lattice for f32

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

source§

impl Lattice for f64

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

source§

impl Lattice for i8

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

source§

impl Lattice for i16

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

source§

impl Lattice for i32

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

source§

impl Lattice for i64

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

source§

impl Lattice for i128

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

source§

impl Lattice for isize

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

source§

impl Lattice for u8

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

source§

impl Lattice for u16

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

source§

impl Lattice for u32

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

source§

impl Lattice for u64

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

source§

impl Lattice for u128

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

source§

impl Lattice for usize

source§

fn meet_join(&self, other: &Self) -> (Self, Self)

Implementors§

source§

impl<O: Operator> Lattice for Id<O>