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,UnweightedCOMPRESS_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>>
impl AlgorithmContainer for QuickUnion<ByRank<Owned>>
type HeuristicKind<'a> = ByRank
Source§type HeuristicContainer<'a, const N: usize> = [usize; N]
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]
type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = [V; N]
Source§type RngKind<'a> = PhantomRng
type RngKind<'a> = PhantomRng
Any kind of RNG
Source§impl<R, const P: bool> AlgorithmContainer for QuickUnion<ByRandom<R>, P>where
R: RngCore,
impl<R, const P: bool> AlgorithmContainer for QuickUnion<ByRandom<R>, P>where
R: RngCore,
type HeuristicKind<'a> = ByRandom<R>
Source§type HeuristicContainer<'a, const N: usize> = [usize; 0]
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]
type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = [V; N]
Source§impl<R, const P: bool> AlgorithmContainer for QuickUnion<ByRandom<R, Borrowed<Thin>>, P>where
R: RngCore,
impl<R, const P: bool> AlgorithmContainer for QuickUnion<ByRandom<R, Borrowed<Thin>>, P>where
R: RngCore,
type HeuristicKind<'a> = ByRandom<R, Borrowed<Thin>>
Source§type HeuristicContainer<'a, const N: usize> = &'a mut [usize]
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]
type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V]
Source§impl<R, const P: bool> AlgorithmContainer for QuickUnion<ByRandom<R, Borrowed<Fat>>, P>where
R: RngCore,
impl<R, const P: bool> AlgorithmContainer for QuickUnion<ByRandom<R, Borrowed<Fat>>, P>where
R: RngCore,
type HeuristicKind<'a> = ByRandom<R, Borrowed>
Source§type HeuristicContainer<'a, const N: usize> = &'a mut [usize]
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]
type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V]
Source§impl<const P: bool> AlgorithmContainer for QuickUnion<ByRank<Borrowed<Thin>>, P>
impl<const P: bool> AlgorithmContainer for QuickUnion<ByRank<Borrowed<Thin>>, P>
type HeuristicKind<'a> = ByRank<Borrowed<Thin>>
Source§type HeuristicContainer<'a, const N: usize> = &'a mut [usize; N]
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]
type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V; N]
Source§type RngKind<'a> = PhantomRng
type RngKind<'a> = PhantomRng
Any kind of RNG
Source§impl<const P: bool> AlgorithmContainer for QuickUnion<ByRank<Borrowed<Fat>>, P>
impl<const P: bool> AlgorithmContainer for QuickUnion<ByRank<Borrowed<Fat>>, P>
type HeuristicKind<'a> = ByRank<Borrowed>
Source§type HeuristicContainer<'a, const N: usize> = &'a mut [usize]
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]
type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V]
Source§type RngKind<'a> = PhantomRng
type RngKind<'a> = PhantomRng
Any kind of RNG
Source§impl<const P: bool> AlgorithmContainer for QuickUnion<BySize<Borrowed<Thin>>, P>
impl<const P: bool> AlgorithmContainer for QuickUnion<BySize<Borrowed<Thin>>, P>
type HeuristicKind<'a> = BySize<Borrowed<Thin>>
Source§type HeuristicContainer<'a, const N: usize> = &'a mut [usize; N]
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]
type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V; N]
Source§type RngKind<'a> = PhantomRng
type RngKind<'a> = PhantomRng
Any kind of RNG
Source§impl<const P: bool> AlgorithmContainer for QuickUnion<BySize<Borrowed<Fat>>, P>
impl<const P: bool> AlgorithmContainer for QuickUnion<BySize<Borrowed<Fat>>, P>
type HeuristicKind<'a> = BySize<Borrowed>
Source§type HeuristicContainer<'a, const N: usize> = &'a mut [usize]
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]
type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V]
Source§type RngKind<'a> = PhantomRng
type RngKind<'a> = PhantomRng
Any kind of RNG
Source§impl AlgorithmContainer for QuickUnion<BySize<Owned>>
impl AlgorithmContainer for QuickUnion<BySize<Owned>>
type HeuristicKind<'a> = BySize
Source§type HeuristicContainer<'a, const N: usize> = [usize; N]
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]
type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = [V; N]
Source§type RngKind<'a> = PhantomRng
type RngKind<'a> = PhantomRng
Any kind of RNG
Source§impl<const P: bool> AlgorithmContainer for QuickUnion<Unweighted<Borrowed<Thin>>, P>
impl<const P: bool> AlgorithmContainer for QuickUnion<Unweighted<Borrowed<Thin>>, P>
type HeuristicKind<'a> = Unweighted<Borrowed<Thin>>
Source§type HeuristicContainer<'a, const N: usize> = [usize; 0]
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]
type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V; N]
Source§type RngKind<'a> = PhantomRng
type RngKind<'a> = PhantomRng
Any kind of RNG
Source§impl<const P: bool> AlgorithmContainer for QuickUnion<Unweighted<Borrowed<Fat>>, P>
impl<const P: bool> AlgorithmContainer for QuickUnion<Unweighted<Borrowed<Fat>>, P>
type HeuristicKind<'a> = Unweighted<Borrowed>
Source§type HeuristicContainer<'a, const N: usize> = [usize; 0]
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]
type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = &'a mut [V]
Source§type RngKind<'a> = PhantomRng
type RngKind<'a> = PhantomRng
Any kind of RNG
Source§impl<const P: bool> AlgorithmContainer for QuickUnion<Unweighted<Owned>, P>
impl<const P: bool> AlgorithmContainer for QuickUnion<Unweighted<Owned>, P>
type HeuristicKind<'a> = Unweighted
Source§type HeuristicContainer<'a, const N: usize> = [usize; 0]
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]
type RepresentativeContainer<'a, V: VertexType + 'a, const N: usize> = [V; N]
Source§type RngKind<'a> = PhantomRng
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>,
impl<H, T, const PATH_COMPRESS: bool> Connected<T> for QuickUnion<H, PATH_COMPRESS>where
T: VertexType,
Self: Find<T>,
fn connected( representative: &mut [T], a: T::IdentifierType, b: T::IdentifierType, ) -> bool
Source§impl<H: Default, const COMPRESS_PATH: bool> Default for QuickUnion<H, COMPRESS_PATH>
impl<H: Default, const COMPRESS_PATH: bool> Default for QuickUnion<H, COMPRESS_PATH>
Source§fn default() -> QuickUnion<H, COMPRESS_PATH>
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>
impl<H, V: VertexType, const COMPRESS_PATH: bool> Find<V> for QuickUnion<H, COMPRESS_PATH>
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>
impl<H, T, const COMPRESS_PATH: bool> Union<T, H> for QuickUnion<H, COMPRESS_PATH>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more