pub struct DynamicSegmentTree<I: PrimInt, M: ActedMonoidWithSize> {
pub n: I,
/* private fields */
}Fields§
§n: IImplementations§
Source§impl<I: PrimInt + ToPrimitive, M: ActedMonoidWithSize> DynamicSegmentTree<I, M>
impl<I: PrimInt + ToPrimitive, M: ActedMonoidWithSize> DynamicSegmentTree<I, M>
pub fn new(min: I, max: I) -> Self
Sourcepub fn get(&mut self, index: I) -> M::Val
pub fn get(&mut self, index: I) -> M::Val
点取得(未生成は M::e_with_size())
- 遅延があるので
pushするため&mut self
Sourcepub fn get_range<R: RangeBounds<I> + Debug>(&mut self, range: R) -> M::Val
pub fn get_range<R: RangeBounds<I> + Debug>(&mut self, range: R) -> M::Val
区間の集約値(RangeBounds を受け取る)
- 遅延があるので
pushするため&mut self
Sourcepub fn apply<R: RangeBounds<I> + Debug>(&mut self, range: R, act: M::Act)
pub fn apply<R: RangeBounds<I> + Debug>(&mut self, range: R, act: M::Act)
区間に作用を適用(遅延)
Source§impl<I, M> DynamicSegmentTree<I, M>
impl<I, M> DynamicSegmentTree<I, M>
Trait Implementations§
Source§impl<I, M> ShowBinaryTree<Ptr> for DynamicSegmentTree<I, M>
impl<I, M> ShowBinaryTree<Ptr> for DynamicSegmentTree<I, M>
Source§fn print_node(&self, ptr: &Ptr) -> String
fn print_node(&self, ptr: &Ptr) -> String
<required> ノードの値を表示する
Source§fn print_as_binary_tree(&self)
fn print_as_binary_tree(&self)
2分木としてフォーマットする
Auto Trait Implementations§
impl<I, M> Freeze for DynamicSegmentTree<I, M>where
I: Freeze,
impl<I, M> RefUnwindSafe for DynamicSegmentTree<I, M>where
I: RefUnwindSafe,
<M as ActedMonoid>::Val: RefUnwindSafe,
<M as ActedMonoid>::Act: RefUnwindSafe,
impl<I, M> Send for DynamicSegmentTree<I, M>
impl<I, M> Sync for DynamicSegmentTree<I, M>
impl<I, M> Unpin for DynamicSegmentTree<I, M>
impl<I, M> UnwindSafe for DynamicSegmentTree<I, 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more