GrPPI  1.0
Generic and Reusable Parallel Pattern Interface
Functions

Interface for applyinng the Reduce pattern. More...

Collaboration diagram for Reduce pattern:

Functions

template<typename Execution , typename InputIt , typename Result , typename Combiner , requires_iterator< InputIt > = 0>
auto grppi::reduce (const Execution &ex, InputIt first, std::size_t size, Result &&identity, Combiner &&combine_op)
 Invoke Reduce pattern with identity value on a data sequence with sequential execution. More...
 
template<typename Execution , typename InputIt , typename Result , typename Combiner , requires_iterator< InputIt > = 0>
auto grppi::reduce (const Execution &ex, InputIt first, InputIt last, Result &&identity, Combiner &&combine_op)
 Invoke Reduce pattern with identity value on a data sequence with sequential execution. More...
 

Detailed Description

Interface for applyinng the Reduce pattern.

Function Documentation

◆ reduce() [1/2]

template<typename Execution , typename InputIt , typename Result , typename Combiner , requires_iterator< InputIt > = 0>
auto grppi::reduce ( const Execution &  ex,
InputIt  first,
InputIt  last,
Result &&  identity,
Combiner &&  combine_op 
)

Invoke Reduce pattern with identity value on a data sequence with sequential execution.

Template Parameters
ExecutionExecution type.
InputItIterator type used for input sequence.
ResultType for the identity value.
CombinerCallable type for the combiner operation.
Parameters
exExecution policy object.
firstIterator to the first element in the input sequence.
lastIterator to one past the end of the input sequence.
identityIdentity value for the combiner operation.
combiner_opCombiner operation for the reduction.
Returns
The result of the reduction.

◆ reduce() [2/2]

template<typename Execution , typename InputIt , typename Result , typename Combiner , requires_iterator< InputIt > = 0>
auto grppi::reduce ( const Execution &  ex,
InputIt  first,
std::size_t  size,
Result &&  identity,
Combiner &&  combine_op 
)

Invoke Reduce pattern with identity value on a data sequence with sequential execution.

Template Parameters
ExecutionExecution type.
InputItIterator type used for input sequence.
ResultType for the identity value.
CombinerCallable type for the combiner operation.
Parameters
exExecution policy object.
firstIterator to the first element in the input sequence.
sizeSize of the input sequence to be process.
identityIdentity value for the combiner operation.
combiner_opCombiner operation for the reduction.
Returns
The result of the reduction.