Template Function sequant::transform_reduce

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))), where reduce and identity are objects of type ReduceLambda and Identity, respectively, is valid

  • UnaryMapOp – a function type such that map(*begin(rng)), where map is an object of type MapLambda, is valid

  • T – a result type of ReduceLambda

Parameters:
  • rng – the Range object

  • init – the initial value for reduction

  • reduce – the ReduceLambda object

  • map – the MapLambda object