Turi Create  4.0

Namespaces

 turi::query_eval
 

Classes

class  turi::query_eval::generic_aggregator< T, AggregateFunctionType >
 
class  turi::broadcast_queue< T, Serializer >
 

Functions

template<typename ResultType , typename ReduceFunctionType , typename AggregateFunctionType >
ResultType turi::query_eval::reduce (std::shared_ptr< planner_node > input, ReduceFunctionType reduce_fn, AggregateFunctionType aggregate_fn, ResultType init=ResultType())
 

Detailed Description

Function Documentation

◆ reduce()

template<typename ResultType , typename ReduceFunctionType , typename AggregateFunctionType >
ResultType turi::query_eval::reduce ( std::shared_ptr< planner_node input,
ReduceFunctionType  reduce_fn,
AggregateFunctionType  aggregate_fn,
ResultType  init = ResultType() 
)

Performs a reduction on input in parallel, this function decides the degree of parallelism, usually depend on number of CPUs.

Parameters
inputThe iterator supports parallel batch reading of items
reduce_fnThe reduction function to use. This must be of the form bool f(const array_value_type&, reduction_type&).
initThe initial value to use in the reduction
Template Parameters
ResultTypeThe type of the intermediate result. Must be serializable
ReduceFunctionTypeThe result type of each reduction.
AggregateFunctionTypeThe type of the reduce function

Definition at line 101 of file aggregates.hpp.