Skip to main content

LcaTable

Struct LcaTable 

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

Precomputed LCA structure with O(1) queries.

Absolute depths use usize: proof-edge re-rooting can form a linear chain, independently of the rank bound on the representative forest.

Implementations§

Source§

impl<T: DenseId> LcaTable<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 LcaTable<T>
where Vec<T>: Freeze, Vec<<T as DenseId>::Index>: Freeze, Vec<Vec<<T as DenseId>::Index>>: Freeze,

§

impl<T> RefUnwindSafe for LcaTable<T>

§

impl<T> Send for LcaTable<T>
where Vec<T>: Send, Vec<<T as DenseId>::Index>: Send, Vec<Vec<<T as DenseId>::Index>>: Send,

§

impl<T> Sync for LcaTable<T>
where Vec<T>: Sync, Vec<<T as DenseId>::Index>: Sync, Vec<Vec<<T as DenseId>::Index>>: Sync,

§

impl<T> Unpin for LcaTable<T>
where Vec<T>: Unpin, Vec<<T as DenseId>::Index>: Unpin, Vec<Vec<<T as DenseId>::Index>>: Unpin,

§

impl<T> UnsafeUnpin for LcaTable<T>

§

impl<T> UnwindSafe for LcaTable<T>
where Vec<T>: UnwindSafe, Vec<<T as DenseId>::Index>: UnwindSafe, Vec<Vec<<T as DenseId>::Index>>: 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.