[−][src]Struct chtholly::ChthollyTree
Representation of Chtholly Tree. The nodes are sorted by their range.
Implementations
impl ChthollyTree
[src]
pub fn from_slice(data: &[u64]) -> Self
[src]
Generate a new Chtholly Tree from a slice.
pub fn split(&mut self, middle: usize) -> Option<&ChthollyNode>
[src]
Split the range between [left, middle - 1]
and [middle, right]
.
Returns the node representing [middle, right]
.
pub fn merge(&mut self, left: usize, right: usize, value: u64)
[src]
Set all values between [left, right]
to be value
, and merge them.
Split nodes when necessary. Create a new node if it does not yet exist.
pub fn add(&mut self, left: usize, right: usize, value: u64)
[src]
Add x
to all values between [left, right]
.
pub fn nth(&self, left: usize, right: usize, n: usize) -> Option<u64>
[src]
Find n
-th (0-indexed) smallest value
after left
.
pub fn pow_sum(&self, left: usize, right: usize, power: u32, modulo: u64) -> u64
[src]
Compute the sum of power between [left, right]
.
Trait Implementations
impl Clone for ChthollyTree
[src]
fn clone(&self) -> ChthollyTree
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ChthollyTree
[src]
impl Eq for ChthollyTree
[src]
impl Hash for ChthollyTree
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<ChthollyTree> for ChthollyTree
[src]
fn eq(&self, other: &ChthollyTree) -> bool
[src]
fn ne(&self, other: &ChthollyTree) -> bool
[src]
impl StructuralEq for ChthollyTree
[src]
impl StructuralPartialEq for ChthollyTree
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,