pub fn aggregate<F, O>(&self, f: F) -> Stream<Circuit<P>, O>
    where
        Z: IndexedZSet<R = O::R> + 'static,
        F: Fn(&Z::Key, &mut Vec<(&Z::Val, Z::R)>) -> O::Key + 'static,
        O: Clone + ZSet + 'static,
        O::R: ZRingValue,
    {
        self.circuit().add_unary_operator(Aggregate::new(f), self)
    }
// TODO: Consider changing the signature of aggregation function to take a slice
// of values instead of iterator.  This is easier to understand and use, and
// allows computing the number of unique values in a group (an important
// aggregate) in `O(1)`.  Most batch implementations will allow extracting
// such a slice efficiently.
/// Aggregate each indexed Z-set in the input stream.
///
/// Values in the input stream are
/// [indexed Z-sets](`crate::algebra::IndexedZSet`). The aggregation
/// function `agg_func` takes a single key and a sorted array of (value,
/// weight) tuples associated with this key and transforms them into a
/// single aggregate value.  The output of the operator is a Z-set
/// computed as a sum of aggregates across all keys with weight `+1`
/// each.
///
/// # Type arguments
///
/// * `Z` - input indexed Z-set type.
/// * `O` - output Z-set type.
Consider changing the signature of aggregation function to take a slice
of values instead of iterator.  This is easier to understand and use, and
allows computing the number of unique values in a group (an important
aggregate) in `O(1)`.  Most batch implementations will allow extracting
such a slice efficiently.
Aggregate each indexed Z-set in the input stream.

Values in the input stream are
[indexed Z-sets](`crate::algebra::IndexedZSet`). The aggregation
function `agg_func` takes a single key and a sorted array of (value,
weight) tuples associated with this key and transforms them into a
single aggregate value.  The output of the operator is a Z-set
computed as a sum of aggregates across all keys with weight `+1`
each.
Consider changing the signature of aggregation function to take a slice of values instead of iterator . This is easier to understand and use and allows computing the number of unique values in a group ( an important aggregate ) in ` O ( 1 ) ` . Most batch implementations will allow extracting such a slice efficiently . Aggregate each indexed Z - set in the input stream . Values in the input stream are [ indexed Z - sets ] ( ` crate :: algebra :: IndexedZSet ` ) . The aggregation function ` agg_func ` takes a single key and a sorted array of ( value weight ) tuples associated with this key and transforms them into a single aggregate value . The output of the operator is a Z - set computed as a sum of aggregates across all keys with weight ` + 1 ` each .
pub fn aggregate<F, O>(&self, f: F) -> Stream<Circuit<P>, O>
    where
        Z: IndexedZSet<R = O::R> + 'static,
        F: Fn(&Z::Key, &mut Vec<(&Z::Val, Z::R)>) -> O::Key + 'static,
        O: Clone + ZSet + 'static,
        O::R: ZRingValue,
    {
        self.circuit().add_unary_operator(Aggregate::new(f), self)
    }
pub fn aggregate < F , O > ( & self , f : F ) -> Stream < Circuit < P > , O > where Z : IndexedZSet < R = O :: R > + ' static , F : Fn ( & Z :: Key , & mut Vec < ( & Z :: Val , Z :: R ) > ) -> O :: Key + ' static , O : Clone + ZSet + ' static , O :: R : ZRingValue , { self . circuit ( ) . add_unary_operator ( Aggregate :: new ( f ) , self ) }
TODO: Consider changing the signature of aggregation function to take a slice
of values instead of iterator.
TODO : Consider changing the signature of aggregation function to take a slice of values instead of iterator .
&self
f
F
type arguments
`Z` - input indexed Z-set type.
`O` - output Z-set type.
` Z ` - input indexed Z - set type . ` O ` - output Z - set type .