Struct differential_dataflow::collection::compact::Compact [] [src]

pub struct Compact<K, V> {
    pub keys: Vec<K>,
    pub cnts: Vec<u32>,
    pub vals: Vec<(V, i32)>,
}

A compressed representation of the accumulation of (key, val, wgt) triples.

Fields

keys: Vec<K>

An ordered list of the distinct keys.

cnts: Vec<u32>

Counts for each key indicating the number of corresponding values in self.vals.

The list is maintained separately in the interest of eventually having run-length coding treat non-repetitions better.

vals: Vec<(V, i32)>

A list of values, ordered within each key group.

Methods

impl<K: Ord + Debug, V: Ord> Compact<K, V>
[src]

fn new(k: usize, v: usize) -> Compact<K, V>

Constructs a new Compact with indicated initial capacities.

Most operations with Compact eventually shrink the amount of memory to fit whatever they have used, so the main concern here is to avoid grossly over-allocating. Typically, these structs are created in a transient compaction step and not maintained open, meaning we can afford to be a bit sloppy.

fn size(&self) -> usize

Reports the size in bytes, used elsewhere to determine how much space we should use for buffering uncompressed elements.

fn extend<I: Iterator<Item=((K, V), i32)>>(&mut self, iterator: I)

Populates the Compact from an iterator of ordered (key, val, wgt) triples.

The Compact does not know about the ordering, only that it should look for repetitions of in the sequences of key and wgt.

fn extend_by(&mut self, buffer: &mut Vec<((K, V), i32)>)

Extends the compact collection by a set of key-value updates.

fn from_radix<U: Unsigned + Default, F: Fn(&K) -> U>(source: &mut Vec<Vec<((K, V), i32)>>, function: &F) -> Option<Compact<K, V>>

Extends the compact collection from the result of a timely_sort radix sorter.

fn session<'a>(&'a mut self) -> CompactSession<'a, K, V>

Creates a new session for introducing one key's worth of values.

fn push<I: Iterator<Item=(V, i32)>>(&mut self, key: K, iterator: I)

Pushes updates for a key from a supplied iterator.

Trait Implementations

impl<K: Debug, V: Debug> Debug for Compact<K, V>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.