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)))
, wherereduce
andidentity
are objects of typeReduceLambda
andIdentity
, respectively, is validUnaryMapOp – a function type such that
map(*begin(rng))
, wheremap
is an object of typeMapLambda
, is validT – a result type of
ReduceLambda
- Parameters:
rng – the
Range
objectinit – the initial value for reduction
reduce – the
ReduceLambda
objectmap – the
MapLambda
object