Struct cuml_map::ExtensibleFenwickTree[][src]

pub struct ExtensibleFenwickTree<V> { /* fields omitted */ }

An extensible version of the Fenwick Tree. ExtensibleFenwickTree uses a FenwickTree internally, but applies an offset to any keys inserted or queried, allowing it to take negative keys. If a key is inserted that is outside the bounds of the underlying FenwickTree, then a new FenwickTree is created with sufficient capacity, all entries from the old tree are inserted into the new tree, and the old tree is dropped.

Methods

impl<V> ExtensibleFenwickTree<V> where
    V: Add<Output = V> + Sub<Output = V> + Zero + Copy + Ord + Debug
[src]

Creates an empty tree with zero initial capacity.

Creates an empty tree with fixed initial capacity.

Creates an empty tree with a capacity c and offset o, such that the tree initially covers the range of keys [o, o+c).

Ensures that the tree will cover key key, in addition to all keys previously covered. Reallocates and rebuilds the tree if necessary.

Trait Implementations

impl<V> CumlMap for ExtensibleFenwickTree<V> where
    V: Add<Output = V> + Sub<Output = V> + Zero + Copy + Ord + Debug
[src]

Type for the keys in this mapping.

Type for the values in this mapping.

Insert an entry into the mapping.

Get the cumulative value up to and including the specified key. Read more

Get the value at the specified key (not the cumulative value).

Get the first key at which the cumulative value equals or exceeds the specified value, if such a key exists. Note that if the result of this function is only defined if the cumulative value is non-decreasing. If you start putting negative values into your mappings, you will get strange results from this function. Read more

Auto Trait Implementations

impl<V> Send for ExtensibleFenwickTree<V> where
    V: Send

impl<V> Sync for ExtensibleFenwickTree<V> where
    V: Sync