[][src]Struct contest_algorithms::range_query::dynamic_arq::DynamicArq

pub struct DynamicArq<T: ArqSpec> { /* fields omitted */ }

A dynamic, and optionally persistent, associative range query data structure.

Implementations

impl<T: ArqSpec> DynamicArq<T>[src]

pub fn new(is_persistent: bool) -> Self[src]

Initializes the data structure without creating any nodes.

pub fn build_from_identity(&mut self, size: i64) -> ArqView[src]

Lazily builds a tree initialized to the identity.

pub fn build_from_slice(&mut self, init_val: &[T::S]) -> ArqView[src]

Builds a tree whose leaves are set to a given non-empty slice.

pub fn merge_equal_sized(
    &mut self,
    (lp, ls): ArqView,
    (rp, rs): ArqView
) -> ArqView
[src]

Merges two balanced subtrees into a single tree with a 0-indexed view.

pub fn push(&mut self, (p, s): ArqView) -> (ArqView, ArqView)[src]

pub fn pull(&mut self, p: usize)[src]

pub fn update(&mut self, view: ArqView, l: i64, r: i64, f: &T::F) -> ArqView[src]

Applies the endomorphism f to all entries from l to r, inclusive. If l == r, the updates are eager. Otherwise, they are lazy.

pub fn query(&mut self, view: ArqView, l: i64, r: i64) -> T::S[src]

Returns the aggregate range query on all entries from l to r, inclusive.

Auto Trait Implementations

impl<T> RefUnwindSafe for DynamicArq<T> where
    <T as ArqSpec>::F: RefUnwindSafe,
    <T as ArqSpec>::S: RefUnwindSafe

impl<T> Send for DynamicArq<T> where
    <T as ArqSpec>::F: Send,
    <T as ArqSpec>::S: Send

impl<T> Sync for DynamicArq<T> where
    <T as ArqSpec>::F: Sync,
    <T as ArqSpec>::S: Sync

impl<T> Unpin for DynamicArq<T> where
    <T as ArqSpec>::F: Unpin,
    <T as ArqSpec>::S: Unpin

impl<T> UnwindSafe for DynamicArq<T> where
    <T as ArqSpec>::F: UnwindSafe,
    <T as ArqSpec>::S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.