pub fn query(&mut self, mut l: usize, mut r: usize) -> T::M {
        l += self.d.len();
        r += self.d.len();
        self.push(l);
        self.push(r);
        let (mut l_agg, mut r_agg) = (T::identity(), T::identity());
        while l <= r {
            if l & 1 == 1 {
                l_agg = T::op(&l_agg, &self.t[l]);
                l += 1;
            }
            if r & 1 == 0 {
                r_agg = T::op(&self.t[r], &r_agg);
                r -= 1;
            }
            l >>= 1;
            r >>= 1;
        }
        T::op(&l_agg, &r_agg)
    }
/// Returns the aggregate range query on all entries from l to r, inclusive.
///
/// # Panics
///
/// Panics if l or r is out of range.
Returns the aggregate range query on all entries from l to r, inclusive.
Returns the aggregate range query on all entries from l to r inclusive .
pub fn query(&mut self, mut l: usize, mut r: usize) -> T::M {
        l += self.d.len();
        r += self.d.len();
        self.push(l);
        self.push(r);
        let (mut l_agg, mut r_agg) = (T::identity(), T::identity());
        while l <= r {
            if l & 1 == 1 {
                l_agg = T::op(&l_agg, &self.t[l]);
                l += 1;
            }
            if r & 1 == 0 {
                r_agg = T::op(&self.t[r], &r_agg);
                r -= 1;
            }
            l >>= 1;
            r >>= 1;
        }
        T::op(&l_agg, &r_agg)
    }
pub fn query ( & mut self , mut l : usize , mut r : usize ) -> T :: M { l += self . d . len ( ) ; r += self . d . len ( ) ; self . push ( l ) ; self . push ( r ) ; let ( mut l_agg , mut r_agg ) = ( T :: identity ( ) , T :: identity ( ) ) ; while l <= r { if l & 1 == 1 { l_agg = T :: op ( & l_agg , & self . t [ l ] ) ; l += 1 ; } if r & 1 == 0 { r_agg = T :: op ( & self . t [ r ] , & r_agg ) ; r -= 1 ; } l >>= 1 ; r >>= 1 ; } T :: op ( & l_agg , & r_agg ) }
Returns the aggregate range query on all entries from l to r, inclusive.
Returns the aggregate range query on all entries from l to r inclusive .
&mut self
l
usize
r
usize
&mut self
l
usize
r
usize
panics
Panics if l or r is out of range.
Panics if l or r is out of range .