Representation of reduce pattern. Represents a reduction that can be used as a stage on a pipeline.
More...
#include <reduce_pattern.h>
template<typename Combiner, typename Identity>
class grppi::reduce_t< Combiner, Identity >
Representation of reduce pattern. Represents a reduction that can be used as a stage on a pipeline.
- Template Parameters
-
Combiner | Callable type for the combine operation used in the reduction. |
Identity | Identity value for the combiner. |
◆ reduce_t()
template<typename Combiner , typename Identity >
Construct a reduction pattern object.
- Parameters
-
wsize | Window size. |
offset | Offset between window starts. |
Id | Identity value. |
combine_op | Combiner used for the reduction. |
◆ add_item()
template<typename Combiner , typename Identity >
Add an item to the reduction buffer. If there are remaining items before reaching the next window start the item is discarded.
- Parameters
-
◆ combiner()
template<typename Combiner , typename Identity >
Get the combiner.
- Returns
- The combiner held by the reduction object.
◆ offset()
template<typename Combiner , typename Identity >
Get the offset.
- Returns
- The offset the reduction object.
◆ operator()()
template<typename Combiner , typename Identity >
template<typename T >
◆ reduce_window()
template<typename Combiner , typename Identity >
template<typename E >
Reduce values from a window.
- Returns
- The result of the reduction.
◆ reduction_needed()
template<typename Combiner , typename Identity >
Check if a reduction can be performed.
- Precondition
- items.size() < static_cast<int>(std::numeric_limits<int>::max())
◆ window_size()
template<typename Combiner , typename Identity >
Get the window size.
- Returns
- The window size of the reduction object.
The documentation for this class was generated from the following file: