Skip to main content

LcaTableCompact

Struct LcaTableCompact 

Source
pub struct LcaTableCompact<T: DenseId> { /* private fields */ }
Expand description

Precomputed LCA structure with delta-encoded depths. It avoids one absolute-depth word per Euler entry. Queries do a short prefix sum to recover absolute depths when comparing candidates.

Implementations§

Source§

impl<T: DenseId> LcaTableCompact<T>

Source

pub fn build<const TRACK: bool>(pp: &VecI<T, T::Index, TRACK>, n: usize) -> Self

Source

pub fn lca(&self, a: T, b: T) -> Option<T>

Auto Trait Implementations§

§

impl<T> Freeze for LcaTableCompact<T>
where Vec<T>: Freeze, Vec<<T as DenseId>::Index>: Freeze, Vec<Vec<(<T as DenseId>::Index, usize)>>: Freeze,

§

impl<T> RefUnwindSafe for LcaTableCompact<T>

§

impl<T> Send for LcaTableCompact<T>
where Vec<T>: Send, Vec<<T as DenseId>::Index>: Send, Vec<Vec<(<T as DenseId>::Index, usize)>>: Send,

§

impl<T> Sync for LcaTableCompact<T>
where Vec<T>: Sync, Vec<<T as DenseId>::Index>: Sync, Vec<Vec<(<T as DenseId>::Index, usize)>>: Sync,

§

impl<T> Unpin for LcaTableCompact<T>
where Vec<T>: Unpin, Vec<<T as DenseId>::Index>: Unpin, Vec<Vec<(<T as DenseId>::Index, usize)>>: Unpin,

§

impl<T> UnsafeUnpin for LcaTableCompact<T>

§

impl<T> UnwindSafe for LcaTableCompact<T>
where Vec<T>: UnwindSafe, Vec<<T as DenseId>::Index>: UnwindSafe, Vec<Vec<(<T as DenseId>::Index, usize)>>: 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.