pub struct SegmentTreeMut<T, F>where
    T: Debug + Clone + PartialEq,
    F: Fn(&T, &T) -> T,{
    pub size: usize,
    /* private fields */
}
Expand description

SegmentTreeMut (Monoid)

  • セグメント木

Fields§

§size: usize

Implementations§

source§

impl<T, F> SegmentTreeMut<T, F>where T: Debug + Clone + PartialEq, F: Fn(&T, &T) -> T,

source

pub fn new(n: usize, e: T, op: F) -> Self

セグメント木を初期化する

source

pub fn build(src: &[T], e: T, op: F) -> Self

セグメント木を配列から初期化する

source

pub fn update(&mut self, index: usize, value: T)

source

pub fn get_mut(&mut self, i: usize) -> Option<ValMut<'_, T, F>>

可変な参照を返す

source

pub fn get_range<R: RangeBounds<usize>>(&self, range: R) -> T

区間rangeの集約を行う

Trait Implementations§

source§

impl<T, F> Debug for SegmentTreeMut<T, F>where T: Debug + Clone + PartialEq, F: Fn(&T, &T) -> T,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, F> Index<usize> for SegmentTreeMut<T, F>where T: Debug + Clone + PartialEq, F: Fn(&T, &T) -> T,

§

type Output = T

The returned type after indexing.
source§

fn index(&self, idx: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<T, F> RefUnwindSafe for SegmentTreeMut<T, F>where F: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, F> Send for SegmentTreeMut<T, F>where F: Send, T: Send,

§

impl<T, F> Sync for SegmentTreeMut<T, F>where F: Sync, T: Sync,

§

impl<T, F> Unpin for SegmentTreeMut<T, F>where F: Unpin, T: Unpin,

§

impl<T, F> UnwindSafe for SegmentTreeMut<T, F>where F: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V