Struct QuickUnion

Source
pub struct QuickUnion<H = ByRank<Owned>, const COMPRESS_PATH: bool = true> { /* private fields */ }
Expand description

QuickUnion algorithm

This algorithm is parameterized by the following

  • H - Heuristic Type. Available types: ByRank, BySize, Unweighted
  • COMPRESS_PATH - boolean value, enables path compression during find operation

By default, ByRank heuristic is used and path compression is enabled

Trait Implementations§

Source§

impl AlgorithmContainer for QuickUnion<ByRank<Owned>>

Source§

type HeuristicKind<'a> = ByRank

Source§

type HeuristicContainer<'a, const N: usize> = [usize; N]

Any kind of contiguous container Read more
Source§

type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = [V; N]

Any kind of contiguous container (should not be ZST). R must also live as long as 'a Read more
Source§

type RngKind<'a> = PhantomRng

Any kind of RNG
Source§

impl<R, const P: bool> AlgorithmContainer for QuickUnion<ByRandom<R>, P>
where R: RngCore,

Source§

type HeuristicKind<'a> = ByRandom<R>

Source§

type HeuristicContainer<'a, const N: usize> = [usize; 0]

Any kind of contiguous container Read more
Source§

type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = [V; N]

Any kind of contiguous container (should not be ZST). R must also live as long as 'a Read more
Source§

type RngKind<'a> = R

Any kind of RNG
Source§

impl<R, const P: bool> AlgorithmContainer for QuickUnion<ByRandom<R, Borrowed<Thin>>, P>
where R: RngCore,

Source§

type HeuristicKind<'a> = ByRandom<R, Borrowed<Thin>>

Source§

type HeuristicContainer<'a, const N: usize> = &'a mut [usize]

Any kind of contiguous container Read more
Source§

type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V]

Any kind of contiguous container (should not be ZST). R must also live as long as 'a Read more
Source§

type RngKind<'a> = R

Any kind of RNG
Source§

impl<R, const P: bool> AlgorithmContainer for QuickUnion<ByRandom<R, Borrowed<Fat>>, P>
where R: RngCore,

Source§

type HeuristicKind<'a> = ByRandom<R, Borrowed>

Source§

type HeuristicContainer<'a, const N: usize> = &'a mut [usize]

Any kind of contiguous container Read more
Source§

type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V]

Any kind of contiguous container (should not be ZST). R must also live as long as 'a Read more
Source§

type RngKind<'a> = R

Any kind of RNG
Source§

impl<const P: bool> AlgorithmContainer for QuickUnion<ByRank<Borrowed<Thin>>, P>

Source§

type HeuristicKind<'a> = ByRank<Borrowed<Thin>>

Source§

type HeuristicContainer<'a, const N: usize> = &'a mut [usize; N]

Any kind of contiguous container Read more
Source§

type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V; N]

Any kind of contiguous container (should not be ZST). R must also live as long as 'a Read more
Source§

type RngKind<'a> = PhantomRng

Any kind of RNG
Source§

impl<const P: bool> AlgorithmContainer for QuickUnion<ByRank<Borrowed<Fat>>, P>

Source§

type HeuristicKind<'a> = ByRank<Borrowed>

Source§

type HeuristicContainer<'a, const N: usize> = &'a mut [usize]

Any kind of contiguous container Read more
Source§

type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V]

Any kind of contiguous container (should not be ZST). R must also live as long as 'a Read more
Source§

type RngKind<'a> = PhantomRng

Any kind of RNG
Source§

impl<const P: bool> AlgorithmContainer for QuickUnion<BySize<Borrowed<Thin>>, P>

Source§

type HeuristicKind<'a> = BySize<Borrowed<Thin>>

Source§

type HeuristicContainer<'a, const N: usize> = &'a mut [usize; N]

Any kind of contiguous container Read more
Source§

type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V; N]

Any kind of contiguous container (should not be ZST). R must also live as long as 'a Read more
Source§

type RngKind<'a> = PhantomRng

Any kind of RNG
Source§

impl<const P: bool> AlgorithmContainer for QuickUnion<BySize<Borrowed<Fat>>, P>

Source§

type HeuristicKind<'a> = BySize<Borrowed>

Source§

type HeuristicContainer<'a, const N: usize> = &'a mut [usize]

Any kind of contiguous container Read more
Source§

type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V]

Any kind of contiguous container (should not be ZST). R must also live as long as 'a Read more
Source§

type RngKind<'a> = PhantomRng

Any kind of RNG
Source§

impl AlgorithmContainer for QuickUnion<BySize<Owned>>

Source§

type HeuristicKind<'a> = BySize

Source§

type HeuristicContainer<'a, const N: usize> = [usize; N]

Any kind of contiguous container Read more
Source§

type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = [V; N]

Any kind of contiguous container (should not be ZST). R must also live as long as 'a Read more
Source§

type RngKind<'a> = PhantomRng

Any kind of RNG
Source§

impl<const P: bool> AlgorithmContainer for QuickUnion<Unweighted<Borrowed<Thin>>, P>

Source§

type HeuristicKind<'a> = Unweighted<Borrowed<Thin>>

Source§

type HeuristicContainer<'a, const N: usize> = [usize; 0]

Any kind of contiguous container Read more
Source§

type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V; N]

Any kind of contiguous container (should not be ZST). R must also live as long as 'a Read more
Source§

type RngKind<'a> = PhantomRng

Any kind of RNG
Source§

impl<const P: bool> AlgorithmContainer for QuickUnion<Unweighted<Borrowed<Fat>>, P>

Source§

type HeuristicKind<'a> = Unweighted<Borrowed>

Source§

type HeuristicContainer<'a, const N: usize> = [usize; 0]

Any kind of contiguous container Read more
Source§

type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V]

Any kind of contiguous container (should not be ZST). R must also live as long as 'a Read more
Source§

type RngKind<'a> = PhantomRng

Any kind of RNG
Source§

impl<const P: bool> AlgorithmContainer for QuickUnion<Unweighted<Owned>, P>

Source§

type HeuristicKind<'a> = Unweighted

Source§

type HeuristicContainer<'a, const N: usize> = [usize; 0]

Any kind of contiguous container Read more
Source§

type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = [V; N]

Any kind of contiguous container (should not be ZST). R must also live as long as 'a Read more
Source§

type RngKind<'a> = PhantomRng

Any kind of RNG
Source§

impl<H, T, const PATH_COMPRESS: bool> Connected<T> for QuickUnion<H, PATH_COMPRESS>
where T: VertexType, Self: Find<T>,

Source§

fn connected( representative: &mut [T], a: T::IdentifierType, b: T::IdentifierType, ) -> bool

Source§

impl<H: Debug, const COMPRESS_PATH: bool> Debug for QuickUnion<H, COMPRESS_PATH>

Source§

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

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

impl<H: Default, const COMPRESS_PATH: bool> Default for QuickUnion<H, COMPRESS_PATH>

Source§

fn default() -> QuickUnion<H, COMPRESS_PATH>

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

impl<H, V: VertexType, const COMPRESS_PATH: bool> Find<V> for QuickUnion<H, COMPRESS_PATH>

Source§

fn find(representative: &mut [V], a: V::IdentifierType) -> V

Source§

impl<H, T, const COMPRESS_PATH: bool> Union<T, H> for QuickUnion<H, COMPRESS_PATH>
where T: VertexType, H: Heuristic, Self: Find<T>,

Source§

fn union_sets<'a>( representative: &mut [T], heuristic: &mut [usize], a: T::IdentifierType, b: T::IdentifierType, r: &mut H::RngProvider, )

Auto Trait Implementations§

§

impl<H, const COMPRESS_PATH: bool> Freeze for QuickUnion<H, COMPRESS_PATH>

§

impl<H, const COMPRESS_PATH: bool> RefUnwindSafe for QuickUnion<H, COMPRESS_PATH>
where H: RefUnwindSafe,

§

impl<H, const COMPRESS_PATH: bool> Send for QuickUnion<H, COMPRESS_PATH>
where H: Send,

§

impl<H, const COMPRESS_PATH: bool> Sync for QuickUnion<H, COMPRESS_PATH>
where H: Sync,

§

impl<H, const COMPRESS_PATH: bool> Unpin for QuickUnion<H, COMPRESS_PATH>
where H: Unpin,

§

impl<H, const COMPRESS_PATH: bool> UnwindSafe for QuickUnion<H, COMPRESS_PATH>
where H: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.