Partition a one-dimensional domain explicitly into subdomains based on a fixed set of splitter GIDs.
More...
template<typename Dom, typename SplitterType = std::vector<typename Dom::index_type>>
class stapl::splitter_partition< Dom, SplitterType >
Partition a one-dimensional domain explicitly into subdomains based on a fixed set of splitter GIDs.
If the original domain is [0..99] and the set of splitters is {6, 25, 88}, then the resulting subdomains produced will be [0..5], [6..24], [25..87], [88..99].
- Template Parameters
-
Dom | Type of the domain to be partitioned |
SplitterType | Container that explicitly stores the splitters |
template<typename Dom , typename SplitterType = std::vector<typename Dom::index_type>>
Create a partition of a domain based on splitters.
The container of splitters must be nonempty and sorted. In addition, if allow_empties is not set, there must be no duplicate splitters.
- Parameters
-
original_dom | The original domain to partition. |
vdom | A vector of splitters |
allow_empties | Flag indicating whether empty domains is allowed. Effectively, the same splitter may not appear twice if allow_empties is false. |
template<typename Dom , typename SplitterType = std::vector<typename Dom::index_type>>
template<typename ODom , typename MFG >
Determine which partition has the elements referenced for the given domain.
The returned information is a collection (possibly empty) of pairs. Each pair contains information about which partitions are included in the given domain and how they are included (True: if is fully contained, False: if is partially included). The returned collection only has elements if there is at least one partition that contains elements on the given domain.
- Example:
- Partition: [0..3],[4..6],[7..9],[10..13]
Given domain: [2..9]
Returns: {([0..0],False),([1..2],True)}
- Parameters
-
dom | Domain to compare |
mfg | Mapping function generator used to get the associated mapping function to each partition. The generated mapping function is used to project generated partitioned domains into the given domain. |
- Returns
- a vector of pairs.