[−][src]Trait differential_dataflow::operators::iterate::Iterate
An extension trait for the iterate method.
Required methods
fn iterate<F>(&self, logic: F) -> Collection<G, D, R> where
G::Timestamp: Lattice,
F: FnOnce(&Collection<Iterative<'a, G, u64>, D, R>) -> Collection<Iterative<'a, G, u64>, D, R>,
G::Timestamp: Lattice,
F: FnOnce(&Collection<Iterative<'a, G, u64>, D, R>) -> Collection<Iterative<'a, G, u64>, D, R>,
Iteratively apply logic to the source collection until convergence.
Importantly, this method does not automatically consolidate results.
It may be important to conclude with consolidate() to ensure that
logically empty collections that contain cancelling records do not
result in non-termination. Operators like group, distinct, and
count also perform consolidation, and are safe to conclude with.
Examples
extern crate timely; extern crate differential_dataflow; use differential_dataflow::input::Input; use differential_dataflow::operators::Iterate; use differential_dataflow::operators::Consolidate; fn main() { ::timely::example(|scope| { scope.new_collection_from(1 .. 10u32).1 .iterate(|values| { values.map(|x| if x % 2 == 0 { x/2 } else { x }) .consolidate() }); }); }
Implementors
impl<G: Scope, D: Ord + Data + Debug, R: Monoid> Iterate<G, D, R> for G[src]
fn iterate<F>(&self, logic: F) -> Collection<G, D, R> where
G::Timestamp: Lattice,
F: FnOnce(&Collection<Iterative<'a, G, u64>, D, R>) -> Collection<Iterative<'a, G, u64>, D, R>, [src]
G::Timestamp: Lattice,
F: FnOnce(&Collection<Iterative<'a, G, u64>, D, R>) -> Collection<Iterative<'a, G, u64>, D, R>,
impl<G: Scope, D: Ord + Data + Debug, R: Abelian> Iterate<G, D, R> for Collection<G, D, R>[src]
fn iterate<F>(&self, logic: F) -> Collection<G, D, R> where
G::Timestamp: Lattice,
F: FnOnce(&Collection<Iterative<'a, G, u64>, D, R>) -> Collection<Iterative<'a, G, u64>, D, R>, [src]
G::Timestamp: Lattice,
F: FnOnce(&Collection<Iterative<'a, G, u64>, D, R>) -> Collection<Iterative<'a, G, u64>, D, R>,