Template Function sequant::transform_reduce¶
Defined in File runtime.hpp
Function Documentation¶
-
template<typename SizedRange, typename T, typename BinaryReductionOp, typename UnaryMapOp>
T sequant::transform_reduce(SizedRange &&rng, T init, const BinaryReductionOp &reduce, const UnaryMapOp &map)¶ Does map+reduce (i.e., std::transform_reduce) on a range using up to get_num_threads() threads.
See also
get_num_threads()
- Template Parameters:
SizedRange – a sized range
BinaryReductionOp – a function type such that
reduce(identity,map(*begin(rng))), wherereduceandidentityare objects of typeReduceLambdaandIdentity, respectively, is validUnaryMapOp – a function type such that
map(*begin(rng)), wheremapis an object of typeMapLambda, is validT – a result type of
ReduceLambda
- Parameters:
rng – the
Rangeobjectinit – the initial value for reduction
reduce – the
ReduceLambdaobjectmap – the
MapLambdaobject