Type Alias UnionFindVec

Source
pub type UnionFindVec<K> = UnionFind<VecMap<K, Cell<K>>>;
Expand description

Vec-backed UnionFind lattice.

Aliased Type§

struct UnionFindVec<K>(/* private fields */);

Implementations

Source§

impl<Map> UnionFind<Map>

Source

pub fn new(val: Map) -> Self

Create a new UnionFind from a Map.

Source

pub fn new_from(val: impl Into<Map>) -> Self

Create a new UnionFind from an Into<Map>.

Source

pub fn as_reveal_ref(&self) -> &Map

Reveal the inner value as a shared reference.

Source

pub fn as_reveal_mut(&mut self) -> &mut Map

Reveal the inner value as an exclusive reference.

Source

pub fn into_reveal(self) -> Map

Gets the inner by value, consuming self.

Source§

impl<Map, K> UnionFind<Map>
where Map: MapMut<K, Cell<K>, Key = K, Item = Cell<K>>, K: Copy + Eq,

Source

pub fn union(&mut self, a: K, b: K) -> Min<bool>

Union the sets containg a and b.

Returns true if the sets changed, false if a and b were already in the same set. Once this returns false it will always return false for the same a and b, therefore it returns a Min<bool> lattice.

Source§

impl<MapSelf, K> UnionFind<MapSelf>
where MapSelf: Map<K, Cell<K>, Key = K, Item = Cell<K>>, K: Copy + Eq,

Source

pub fn same(&self, a: K, b: K) -> Max<bool>

Returns if a and b are in the same set.

This method is monotonic: once this returns true it will always return true for the same a and b, therefore it returns a Max<bool> lattice.

Trait Implementations

Source§

impl<Map, K> Atomize for UnionFind<Map>
where Map: 'static + MapMut<K, Cell<K>, Key = K, Item = Cell<K>> + IntoIterator<Item = (K, Cell<K>)>, K: 'static + Copy + Eq,

Source§

type Atom = UnionFind<SingletonMap<K, Cell<K>>>

The type of atoms for this lattice.
Source§

type AtomIter = Box<dyn Iterator<Item = <UnionFind<Map> as Atomize>::Atom>>

The iter type iterating the antichain atoms.
Source§

fn atomize(self) -> Self::AtomIter

Atomize self: convert into an iter of atoms. Read more
Source§

impl<Map: Clone> Clone for UnionFind<Map>

Source§

fn clone(&self) -> UnionFind<Map>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Map: Debug> Debug for UnionFind<Map>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Map> DeepReveal for UnionFind<Map>

Source§

type Revealed = Map

The underlying type when revealed.
Source§

fn deep_reveal(self) -> Self::Revealed

Reveals the underlying lattice types recursively.
Source§

impl<Map: Default> Default for UnionFind<Map>

Source§

fn default() -> UnionFind<Map>

Returns the “default value” for a type. Read more
Source§

impl<'de, Map> Deserialize<'de> for UnionFind<Map>
where Map: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<Map, K> IsBot for UnionFind<Map>
where Map: MapIter<Key = K, Item = Cell<K>>, K: Copy + Eq,

Source§

fn is_bot(&self) -> bool

Returns if self is lattice bottom (⊥). Read more
Source§

impl<Map> IsTop for UnionFind<Map>

Source§

fn is_top(&self) -> bool

Returns if self is lattice top (⊤). Read more
Source§

impl<MapSelf, MapOther, K> LatticeFrom<UnionFind<MapOther>> for UnionFind<MapSelf>
where MapSelf: Keyed<Key = K, Item = Cell<K>> + FromIterator<(K, Cell<K>)>, MapOther: IntoIterator<Item = (K, Cell<K>)>, K: Copy + Eq,

Source§

fn lattice_from(other: UnionFind<MapOther>) -> Self

Convert from the Other lattice into Self.
Source§

impl<MapSelf, MapOther, K> Merge<UnionFind<MapOther>> for UnionFind<MapSelf>
where MapSelf: MapMut<K, Cell<K>, Key = K, Item = Cell<K>>, MapOther: IntoIterator<Item = (K, Cell<K>)>, K: Copy + Eq,

Source§

fn merge(&mut self, other: UnionFind<MapOther>) -> bool

Merge other into the self lattice. Read more
Source§

fn merge_owned(this: Self, delta: Other) -> Self
where Self: Sized,

Merge this and delta together, returning the new value.
Source§

impl<MapSelf, MapOther, K> PartialEq<UnionFind<MapOther>> for UnionFind<MapSelf>
where MapSelf: MapMut<K, Cell<K>, Key = K, Item = Cell<K>> + MapIter, MapOther: MapMut<K, Cell<K>, Key = K, Item = Cell<K>> + MapIter, K: Copy + Eq,

Source§

fn eq(&self, other: &UnionFind<MapOther>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<MapSelf, MapOther, K> PartialOrd<UnionFind<MapOther>> for UnionFind<MapSelf>
where MapSelf: MapMut<K, Cell<K>, Key = K, Item = Cell<K>> + MapIter, MapOther: MapMut<K, Cell<K>, Key = K, Item = Cell<K>> + MapIter, K: Copy + Eq,

Source§

fn partial_cmp(&self, other: &UnionFind<MapOther>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<Map> Serialize for UnionFind<Map>
where Map: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<Map: Copy> Copy for UnionFind<Map>

Source§

impl<Map> Eq for UnionFind<Map>
where Self: PartialEq,

Source§

impl<MapSelf, MapOther> LatticeOrd<UnionFind<MapOther>> for UnionFind<MapSelf>
where Self: PartialOrd<UnionFind<MapOther>>,