Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Local Operations (LOps)
+ Collaboration diagram for Local Operations (LOps):

Functions

template<typename FirstDIA , typename... DIAs>
auto Union (const FirstDIA &first_dia, const DIAs &...dias)
 Union is a LOp, which creates the union of all items from any number of DIAs as a single DIA, where the items are in an arbitrary order. More...
 
template<typename ValueType >
auto Union (const std::initializer_list< DIA< ValueType > > &dias)
 Union is a LOp, which creates the union of all items from any number of DIAs as a single DIA, where the items are in an arbitrary order. More...
 
template<typename ValueType >
auto Union (const std::vector< DIA< ValueType > > &dias)
 Union is a LOp, which creates the union of all items from any number of DIAs as a single DIA, where the items are in an arbitrary order. More...
 

Local Operations (LOps)

template<typename MapFunction >
auto Map (const MapFunction &map_function) const
 Map applies map_function : \( A \to B \) to each item of a DIA and delivers a new DIA contains the returned values, which may be of a different type. More...
 
template<typename FilterFunction >
auto Filter (const FilterFunction &filter_function) const
 Each item of a DIA is tested using filter_function : \( A \to \textrm{bool} \) to determine whether it is copied into the output DIA or excluded. More...
 
template<typename ResultType = ValueType, typename FlatmapFunction >
auto FlatMap (const FlatmapFunction &flatmap_function) const
 Each item of a DIA is expanded by the flatmap_function : \( A \to \textrm{array}(B) \) to zero or more items of different type, which are concatenated in the resulting DIA. More...
 
auto BernoulliSample (double p) const
 Each item of a DIA is copied into the output DIA with success probability p (an independent Bernoulli trial). More...
 
template<typename SecondDIA >
auto Union (const SecondDIA &second_dia) const
 Union is a LOp, which creates the union of all items from any number of DIAs as a single DIA, where the items are in an arbitrary order. More...
 

Detailed Description

Function Documentation

auto BernoulliSample ( double  p) const

Each item of a DIA is copied into the output DIA with success probability p (an independent Bernoulli trial).

Definition at line 90 of file bernoulli_sample.hpp.

auto Filter ( const FilterFunction &  filter_function) const
inline

Each item of a DIA is tested using filter_function : \( A \to \textrm{bool} \) to determine whether it is copied into the output DIA or excluded.

The function chain of the returned DIA is this DIA's stack_ chained with filter_function.

Parameters
filter_functionFilter function of type FilterFunction, which maps each element to a boolean.

Definition at line 386 of file dia.hpp.

References DIABase::context(), DIA< ValueType_, Stack_ >::context(), DIA< ValueType_, Stack_ >::id_, DIA< ValueType_, Stack_ >::IsValid(), Context::logger_, Context::next_dia_id(), DIA< ValueType_, Stack_ >::node_, DIA< ValueType_, Stack_ >::stack_, and gen_data::value.

auto FlatMap ( const FlatmapFunction &  flatmap_function) const
inline

Each item of a DIA is expanded by the flatmap_function : \( A \to \textrm{array}(B) \) to zero or more items of different type, which are concatenated in the resulting DIA.

The return type of flatmap_function must be specified as template parameter.

FlatMap is a LOp, which maps this DIA according to the flatmap_function given by the user. The flatmap_function maps each element to elements of a possibly different type. The flatmap_function has an emitter function as it's second parameter. This emitter is called once for each element to be emitted. The function chain of the returned DIA is this DIA's stack_ chained with flatmap_function.

Template Parameters
ResultTypeResultType of the FlatmapFunction, if different from item type of DIA.
Parameters
flatmap_functionMap function of type FlatmapFunction, which maps each element to elements of a possibly different type.

Definition at line 437 of file dia.hpp.

References DIABase::context(), DIA< ValueType_, Stack_ >::context(), DIA< ValueType_, Stack_ >::id_, DIA< ValueType_, Stack_ >::IsValid(), Context::logger_, Context::next_dia_id(), DIA< ValueType_, Stack_ >::node_, and DIA< ValueType_, Stack_ >::stack_.

auto Map ( const MapFunction &  map_function) const
inline

Map applies map_function : \( A \to B \) to each item of a DIA and delivers a new DIA contains the returned values, which may be of a different type.

The function chain of the returned DIA is this DIA's stack_ chained with map_fn.

Parameters
map_functionMap function of type MapFunction, which maps each element to an element of a possibly different type.

Definition at line 341 of file dia.hpp.

References DIABase::context(), DIA< ValueType_, Stack_ >::context(), DIA< ValueType_, Stack_ >::id_, DIA< ValueType_, Stack_ >::IsValid(), Context::logger_, Context::next_dia_id(), DIA< ValueType_, Stack_ >::node_, DIA< ValueType_, Stack_ >::stack_, and gen_data::value.

auto thrill::api::Union ( const FirstDIA &  first_dia,
const DIAs &...  dias 
)

Union is a LOp, which creates the union of all items from any number of DIAs as a single DIA, where the items are in an arbitrary order.

All input DIAs must contain the same type, which is also the output DIA's type.

The Union operation concatenates all local pieces of a DIA, no rebalancing is performed, and no communication is needed.

Parameters
first_diafirst DIA
diasDIAs, which are unified with the first DIA.

Definition at line 320 of file union.hpp.

References tlx::vexpand().

Referenced by examples::suffix_sorting::DC3Recursive(), examples::suffix_sorting::DC7Recursive(), examples::suffix_sorting::PrefixDoublingDiscarding(), examples::suffix_sorting::PrefixQuadruplingDiscarding(), and DIA< ValueType_, Stack_ >::Union().

auto thrill::api::Union ( const std::initializer_list< DIA< ValueType > > &  dias)

Union is a LOp, which creates the union of all items from any number of DIAs as a single DIA, where the items are in an arbitrary order.

All input DIAs must contain the same type, which is also the output DIA's type.

The Union operation concatenates all local pieces of a DIA, no rebalancing is performed, and no communication is needed.

Parameters
diasDIAs, which are unified.

Definition at line 344 of file union.hpp.

auto thrill::api::Union ( const std::vector< DIA< ValueType > > &  dias)

Union is a LOp, which creates the union of all items from any number of DIAs as a single DIA, where the items are in an arbitrary order.

All input DIAs must contain the same type, which is also the output DIA's type.

The Union operation concatenates all local pieces of a DIA, no rebalancing is performed, and no communication is needed.

Parameters
diasDIAs, which are unified.

Definition at line 367 of file union.hpp.

auto Union ( const SecondDIA< ValueType_, Stack_ > &  second_dia) const

Union is a LOp, which creates the union of all items from any number of DIAs as a single DIA, where the items are in an arbitrary order.

All input DIAs must contain the same type, which is also the output DIA's type.

The Union operation concatenates all local pieces of a DIA, no rebalancing is performed, and no communication is needed.

Definition at line 379 of file union.hpp.

References thrill::api::Union().