pub struct SegmentTreeMap<M>where
M: Monoid,{ /* private fields */ }
Implementations§
Source§impl<M> SegmentTreeMap<M>where
M: Monoid,
impl<M> SegmentTreeMap<M>where
M: Monoid,
pub fn new(n: usize) -> Self
pub fn set(&mut self, k: usize, x: M::T)
pub fn update(&mut self, k: usize, x: M::T)
pub fn get(&self, k: usize) -> M::T
pub fn fold<R>(&self, range: R) -> M::Twhere
R: RangeBounds<usize>,
Sourcepub fn position_acc<R, F>(&self, range: R, f: F) -> Option<usize>
pub fn position_acc<R, F>(&self, range: R, f: F) -> Option<usize>
Returns the first index that satisfies a accumlative predicate.
Sourcepub fn rposition_acc<R, F>(&self, range: R, f: F) -> Option<usize>
pub fn rposition_acc<R, F>(&self, range: R, f: F) -> Option<usize>
Returns the last index that satisfies a accumlative predicate.
Source§impl<M> SegmentTreeMap<M>where
M: AbelianMonoid,
impl<M> SegmentTreeMap<M>where
M: AbelianMonoid,
Trait Implementations§
Source§impl<M> Clone for SegmentTreeMap<M>where
M: Monoid,
impl<M> Clone for SegmentTreeMap<M>where
M: Monoid,
Auto Trait Implementations§
impl<M> Freeze for SegmentTreeMap<M>
impl<M> RefUnwindSafe for SegmentTreeMap<M>
impl<M> Send for SegmentTreeMap<M>
impl<M> Sync for SegmentTreeMap<M>
impl<M> Unpin for SegmentTreeMap<M>
impl<M> UnwindSafe for SegmentTreeMap<M>
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