Overlapping partition for one dimensional domains. More...
Public Member Functions | |
overlap_partition (value_type const &domain, size_t c=1, size_t l=0, size_t r=0) | |
Overlap partition constructor. More... | |
overlap_partition (value_type const &domain, overlap_partition const &other) | |
Copy constructor that replaces the domain with the domain provided. | |
Dom const & | global_domain () const |
value_type | operator[] (size_t idx) const |
Returns the idx-th domain in the partition. | |
size_t | size () const |
Return the number of partitions generated. | |
index_type | find (gid_type const &g) const |
Returns the index of the partition that contains the GID g . | |
template<typename ODom , typename MFG > | |
std::vector< std::pair< domain_type, bool > > | contained_in (ODom const &dom, MFG const &mfg) |
Determine which partition has the elements referenced for the given domain. More... | |
Public Types | |
typedef indexed_domain< size_t > | domain_type |
typedef Dom | value_type |
typedef value_type::index_type | gid_type |
typedef domain_type::index_type | index_type |
Overlapping partition for one dimensional domains.
A domain is partitioned based on the specified number of elements overlapped.
Dom | Domain type. |
stapl::overlap_partition< Dom >::overlap_partition | ( | value_type const & | domain, |
size_t | c = 1 , |
||
size_t | l = 0 , |
||
size_t | r = 0 |
||
) |
Overlap partition constructor.
The overlapped domains are defined by specifying the number of elements that form the non-overlapped core subdomains (c
), the number of elements overlapped on the left of each core subdomain (l
) and the number of elements overlapped on the right (r
).
The number of generated subdomains is always equal to the number of core subdomains and their size is l+c+r
, except for the boundary subdomains, which are clipped so as to fit into the original domain.
domain | Domain to partition. |
c | Number of elements in the core of each subdomain (not overlapped) |
l | Number of elements to the left of the core (overlapping the previous subdomain(s)) |
r | Number of elements to the right of the core (overlapping the next subdomain(s)) |
std::vector<std::pair<domain_type,bool> > stapl::overlap_partition< Dom >::contained_in | ( | ODom const & | dom, |
MFG const & | 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 it is fully contained, False: if it is partially included). The returned collection contains elements for the partitions that contain elements on the given domain.
Used by segmented_metadata_projection.
dom | Domain to compare |
mfg | Mapping function generator used to get the associated mapping function to each partition. Note that overlap_view fixes all mapping functions generated by mfg to identity_mf; these are used to map each overlapped subview domain to the original view domain, which itself can be mapped to the underlying container domain by an arbitrary mapping function of the original view. |