CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::HalvePartitioner Class Reference

The halve partitioner always splits the sequence into two parts of roughly equal size. More...

#include <CeresEngine/Foundation/Algorithm/Partitioner.hpp>

Public Member Functions

constexpr HalvePartitioner (const std::size_t minimumGrainSize)
 Halve partition constructor.
 
template<typename I , typename S >
auto operator() (I first, S last)
 Split a range of elements.
 

Private Attributes

std::size_t mMinimumGrainSize
 

Detailed Description

The halve partitioner always splits the sequence into two parts of roughly equal size.

The sequence is split up to a minimum grain size. As a concept, the result from the partitioner is considered a suggestion for parallelization. For algorithms such as for_each, a partitioner with a very small grain size might be appropriate if the operation is very expensive. Some algorithms, such as a binary search, might naturally adjust this suggestion so that the result makes sense.

Constructor & Destructor Documentation

◆ HalvePartitioner()

constexpr CeresEngine::HalvePartitioner::HalvePartitioner ( const std::size_t  minimumGrainSize)
inlineexplicitconstexpr

Halve partition constructor.

Parameters
mMinimumGrainSizeMinimum grain size used to split ranges

Member Function Documentation

◆ operator()()

template<typename I , typename S >
auto CeresEngine::HalvePartitioner::operator() ( I  first,
S  last 
)
inline

Split a range of elements.

Template Parameters
IIterator type
SSentinel type
Parameters
firstFirst element in range
lastLast element in range
Returns
Iterator to point where sequence should be split

Member Data Documentation

◆ mMinimumGrainSize

std::size_t CeresEngine::HalvePartitioner::mMinimumGrainSize
private

The documentation for this class was generated from the following file: