Skip to main content

SeekByRaccCond

Struct SeekByRaccCond 

Source
pub struct SeekByRaccCond<Spec, L, F>
where L: LazyMapMonoid,
{ acc: L::Agg, f: F, _marker: PhantomData<fn() -> (Spec, L)>, }

Fields§

§acc: L::Agg§f: F§_marker: PhantomData<fn() -> (Spec, L)>

Implementations§

Source§

impl<Spec, L, F> SeekByRaccCond<Spec, L, F>
where L: LazyMapMonoid, F: FnMut(&L::Agg) -> bool,

Source

pub fn new(f: F) -> Self

Examples found in repository?
crates/competitive/src/data_structure/treap.rs (line 447)
441    pub fn find_by_racc_cond<F>(&mut self, f: F) -> Option<BstNodeId<TreapSpec<M, L>>>
442    where
443        F: FnMut(&L::Agg) -> bool,
444    {
445        let split = Split::new(
446            &mut self.root,
447            SeekByRaccCond::<TreapSpec<M, L>, L, F>::new(f),
448            EqualSide::Left,
449        );
450        let node = split.left()?.rightmost();
451        self.node_id_manager.registered_node_id(node)
452    }
More examples
Hide additional examples
crates/competitive/src/data_structure/implicit_splay_tree.rs (line 382)
377    pub fn rpartition_point_acc<F>(&mut self, right: usize, mut pred: F) -> usize
378    where
379        F: FnMut(&T::Agg) -> bool,
380    {
381        let mut split3 = Split3::seek_by_size(&mut self.root, ..right);
382        let split = split3.split_mid(SeekByRaccCond::new(|acc| !pred(acc)), EqualSide::Left);
383        split
384            .left()
385            .map(|node| node.into_data().size)
386            .unwrap_or_default()
387    }
crates/competitive/src/data_structure/implicit_treap.rs (line 486)
481    pub fn rpartition_point_acc<F>(&mut self, right: usize, mut pred: F) -> usize
482    where
483        F: FnMut(&T::Agg) -> bool,
484    {
485        let mut split3 = Split3::seek_by_size(&mut self.root, ..right);
486        let split = split3.split_mid(SeekByRaccCond::new(|acc| !pred(acc)), EqualSide::Left);
487        split
488            .left()
489            .map(|node| node.into_data().size)
490            .unwrap_or_default()
491    }

Trait Implementations§

Source§

impl<Spec, L, F> BstSeeker for SeekByRaccCond<Spec, L, F>
where Spec: BstSpec<Data: BstDataAccess<LazyMap, Value = LazyMapElement<L>>>, L: LazyMapMonoid, F: FnMut(&L::Agg) -> bool,

Source§

type Spec = Spec

Source§

fn bst_seek(&mut self, node: BstImmutRef<'_, Self::Spec>) -> Ordering

Auto Trait Implementations§

§

impl<Spec, L, F> Freeze for SeekByRaccCond<Spec, L, F>

§

impl<Spec, L, F> RefUnwindSafe for SeekByRaccCond<Spec, L, F>

§

impl<Spec, L, F> Send for SeekByRaccCond<Spec, L, F>
where <L as LazyMapMonoid>::Agg: Send, F: Send, PhantomData<fn() -> (Spec, L)>: Send,

§

impl<Spec, L, F> Sync for SeekByRaccCond<Spec, L, F>
where <L as LazyMapMonoid>::Agg: Sync, F: Sync, PhantomData<fn() -> (Spec, L)>: Sync,

§

impl<Spec, L, F> Unpin for SeekByRaccCond<Spec, L, F>

§

impl<Spec, L, F> UnsafeUnpin for SeekByRaccCond<Spec, L, F>

§

impl<Spec, L, F> UnwindSafe for SeekByRaccCond<Spec, L, F>

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> ToArrayVecScalar for T

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.