pub enum AssignSum {}
Expand description
Range Sum Query, a slightly trickier classic application of ARQ. update(l, r, &f) sets all entries a[l..=r] to f. query(l, r) sums all the entries a[l..=r].
§Panics
Associated functions will panic on overflow.
Trait Implementations§
Source§impl ArqSpec for AssignSum
impl ArqSpec for AssignSum
Source§fn op(a: &Self::S, b: &Self::S) -> Self::S
fn op(a: &Self::S, b: &Self::S) -> Self::S
Must satisfy the Associative Law:
For all a,b,c, op(a, op(b, c)) = op(op(a, b), c)
Source§fn identity() -> Self::S
fn identity() -> Self::S
Must satisfy the Identity Law:
For all a, op(a, identity()) = op(identity(), a) = a
Auto Trait Implementations§
impl Freeze for AssignSum
impl RefUnwindSafe for AssignSum
impl Send for AssignSum
impl Sync for AssignSum
impl Unpin for AssignSum
impl UnwindSafe for AssignSum
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