STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types
stapl::overlap_partition< Dom > Struct Template Reference

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
 

Detailed Description

template<typename Dom>
struct stapl::overlap_partition< Dom >

Overlapping partition for one dimensional domains.

A domain is partitioned based on the specified number of elements overlapped.

Template Parameters
DomDomain type.

Constructor & Destructor Documentation

◆ overlap_partition()

template<typename Dom >
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.

Example:
Domain to partition: [0..10]
non overlap (c): 3
left overlap (l): 2
right overlap (r): 1
Core subdomains (non-overlapping): {[0..2],[3..5],[6..8],[9..10]}
Resulting partition: {[0..3],[1..6],[4..9],[7..10]}
Parameters
domainDomain to partition.
cNumber of elements in the core of each subdomain (not overlapped)
lNumber of elements to the left of the core (overlapping the previous subdomain(s))
rNumber of elements to the right of the core (overlapping the next subdomain(s))

Member Function Documentation

◆ contained_in()

template<typename Dom >
template<typename ODom , typename MFG >
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.

Example:
Partition: [{[0..3],[1..6],[4..9],[7..10]}
Given domain: [0..4]
Returns: {([0..0],True),([1..2],False)}

Used by segmented_metadata_projection.

Parameters
domDomain to compare
mfgMapping 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.
Returns
a vector of pairs.

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