Trait cuml_map::CumlMap[][src]

pub trait CumlMap {
    type Key;
    type Value;
    fn insert(&mut self, _: Self::Key, _: Self::Value);
fn get_cuml(&self, _: Self::Key) -> Self::Value;
fn get_single(&self, _: Self::Key) -> Self::Value;
fn get_quantile(&self, _: Self::Value) -> Option<Self::Key>; }

Trait for building and querying mappings between keys and cumulative values.

Associated Types

Type for the keys in this mapping.

Type for the values in this mapping.

Required Methods

Insert an entry into the mapping.

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

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.

Implementors