STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Public Attributes
stapl::explicit_partition< Dom, SubDom, Storage > Class Template Reference

Partition a one-dimensional domain explicitly into subdomains that are stored in a container. More...

Public Member Functions

 explicit_partition (Dom const &original_dom, vec_dom_type const &vdom)
 Create a partition of a domain based on an explicit container of subdomains. More...
 
value_type operator[] (size_t idx) const
 Return the subdomain at a given index. This is the inverse of find. More...
 
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. More...
 
template<typename ODom , typename MFG >
std::vector< std::pair< domain_type, bool > > contained_in (ODom const &dom, MFG)
 Determine which partition has the elements referenced for the given domain. More...
 
domain_type domain () const
 Get the partition's domain [0, .., p-1].
 
value_type const & global_domain () const
 Return the original domain that was used to create subdomains.
 

Public Types

typedef Dom view_domain_type
 The original domain to partition.
 
typedef indexed_domain< size_t > domain_type
 The domain of the partitioner itself (i.e., the domain [0, ..., p-1])
 
typedef SubDom value_type
 Type of the subdomains produced by the partition.
 
typedef value_type::index_type gid_type
 Type of the GIDs in the subdomains.
 
typedef domain_type::index_type index_type
 Type used to describe the i'th subdomain.
 

Public Attributes

vec_dom_type m_part
 Explict storage for the subdomains.
 
view_domain_type m_domain
 The original domain to partition.
 

Detailed Description

template<typename Dom, typename SubDom = Dom, typename Storage = std::vector<Dom>>
class stapl::explicit_partition< Dom, SubDom, Storage >

Partition a one-dimensional domain explicitly into subdomains that are stored in a container.

Template Parameters
DomType of the domain to be partitioned
SubDomType of the subdomains that are produced
StorageContainer that explicitly stores the subdomains

Constructor & Destructor Documentation

◆ explicit_partition()

template<typename Dom , typename SubDom = Dom, typename Storage = std::vector<Dom>>
stapl::explicit_partition< Dom, SubDom, Storage >::explicit_partition ( Dom const &  original_dom,
vec_dom_type const &  vdom 
)

Create a partition of a domain based on an explicit container of subdomains.

Parameters
original_domThe original domain to partition
vdomContainer of subdomains

Member Function Documentation

◆ operator[]()

template<typename Dom , typename SubDom = Dom, typename Storage = std::vector<Dom>>
value_type stapl::explicit_partition< Dom, SubDom, Storage >::operator[] ( size_t  idx) const

Return the subdomain at a given index. This is the inverse of find.

Parameters
idxThe index of the subdomain, which should be from 0 to size() - 1.

◆ find()

template<typename Dom , typename SubDom = Dom, typename Storage = std::vector<Dom>>
index_type stapl::explicit_partition< Dom, SubDom, Storage >::find ( gid_type const &  g) const

Returns the index of the partition that contains the gid g.

Parameters
ggid to find
Returns
The index of the subdomain that contains g

◆ contained_in()

template<typename Dom , typename SubDom = Dom, typename Storage = std::vector<Dom>>
template<typename ODom , typename MFG >
std::vector<std::pair<domain_type,bool> > stapl::explicit_partition< Dom, SubDom, Storage >::contained_in ( ODom const &  dom,
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
domDomain to compare
mfgMapping 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.

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