STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types
stapl::implicit_regular_mesh_domain< COORDINATES, TRAVERSAL > Class Template Reference

Implicit domain representing the cells of a regular mesh. More...

Public Member Functions

 implicit_regular_mesh_domain ()
 Constructs an empty regular mesh domain.
 
 implicit_regular_mesh_domain (tuple_type const &first_elt, tuple_type const &l_sizes, tuple_type const &g_sizes)
 
 implicit_regular_mesh_domain (tuple_type const &l_sizes)
 Constructor taking the size of the mesh in each dimension, the coordinates of the origin are set to 0. More...
 
 implicit_regular_mesh_domain (tuple_type const &first_elt, tuple_type const &last_elt, implicit_regular_mesh_domain const &other)
 Constructor creating a restricted domain given a first element first_elt, a last element last_elt and another domain other. More...
 
 implicit_regular_mesh_domain (index_type const &first_elt, index_type const &last_elt, implicit_regular_mesh_domain const &other)
 
size_type size () const
 Returns the number of elements in the domain.
 
tuple_type get_local_sizes () const
 Returns a tuple with the number of elements in each dimension.
 
gid_type first () const
 Returns the first index in the domain.
 
gid_type last () const
 Returns the last index in the domain.
 
gid_type open_last () const
 Returns the index after the last one.
 
bool contains (gid_type const &idx) const
 Check if the index idx is in the domain. More...
 
bool contains (tuple_type const &pos) const
 Check if the tuple index pos is in the domain. More...
 
gid_type advance (gid_type const &idx, long const &n) const
 Advance an index idx by n positions in the domain. More...
 
size_t distance (gid_type const &i0, gid_type const &i1) const
 Return the positive distance between two indices based on the domain order. More...
 
gid_type linearize (tuple_type const &t1) const
 Linearize a tuple index based on the domain. More...
 
tuple_type reverse_linearize (gid_type const &id) const
 Reverse linearize an index based on the domain. More...
 
bool empty () const
 Returns true if domain is empty.
 
bool is_same_container_domain () const
 Returns true if domain is the same as the container domain.
 
implicit_regular_mesh_domain operator & (implicit_regular_mesh_domain const &other)
 Intersect the domain with another domain. More...
 

Public Types

typedef COORDINATES tuple_type
 
typedef size_t gid_type
 
typedef gid_type index_type
 
typedef size_t size_type
 

Detailed Description

template<class COORDINATES, class TRAVERSAL = typename default_traversal <tuple_size<COORDINATES>::value>::type>
class stapl::implicit_regular_mesh_domain< COORDINATES, TRAVERSAL >

Implicit domain representing the cells of a regular mesh.

Template Parameters
COORDINATEScoordinates type of domain element.
TRAVERSALtraversal type for the linearization of mesh cells.

Constructor & Destructor Documentation

◆ implicit_regular_mesh_domain() [1/3]

template<class COORDINATES, class TRAVERSAL = typename default_traversal <tuple_size<COORDINATES>::value>::type>
stapl::implicit_regular_mesh_domain< COORDINATES, TRAVERSAL >::implicit_regular_mesh_domain ( tuple_type const &  first_elt,
tuple_type const &  l_sizes,
tuple_type const &  g_sizes 
)
Parameters
first_eltposition of the first cell of the mesh.
l_sizessize in each dimension of the mesh.
g_sizessize in each dimension of the whole mesh if this domain represents a partition.

◆ implicit_regular_mesh_domain() [2/3]

template<class COORDINATES, class TRAVERSAL = typename default_traversal <tuple_size<COORDINATES>::value>::type>
stapl::implicit_regular_mesh_domain< COORDINATES, TRAVERSAL >::implicit_regular_mesh_domain ( tuple_type const &  l_sizes)

Constructor taking the size of the mesh in each dimension, the coordinates of the origin are set to 0.

Parameters
l_sizessize in each dimension of the mesh.

◆ implicit_regular_mesh_domain() [3/3]

template<class COORDINATES, class TRAVERSAL = typename default_traversal <tuple_size<COORDINATES>::value>::type>
stapl::implicit_regular_mesh_domain< COORDINATES, TRAVERSAL >::implicit_regular_mesh_domain ( tuple_type const &  first_elt,
tuple_type const &  last_elt,
implicit_regular_mesh_domain< COORDINATES, TRAVERSAL > const &  other 
)

Constructor creating a restricted domain given a first element first_elt, a last element last_elt and another domain other.

Parameters
first_eltfirst element.
last_eltlast element.
otherother domain.

Member Function Documentation

◆ contains() [1/2]

template<class COORDINATES, class TRAVERSAL = typename default_traversal <tuple_size<COORDINATES>::value>::type>
bool stapl::implicit_regular_mesh_domain< COORDINATES, TRAVERSAL >::contains ( gid_type const &  idx) const

Check if the index idx is in the domain.

Parameters
idxindex.
Returns
true if idx is in the domain.

◆ contains() [2/2]

template<class COORDINATES, class TRAVERSAL = typename default_traversal <tuple_size<COORDINATES>::value>::type>
bool stapl::implicit_regular_mesh_domain< COORDINATES, TRAVERSAL >::contains ( tuple_type const &  pos) const

Check if the tuple index pos is in the domain.

Parameters
posindex tuple.
Returns
true if pos is in the domain.

◆ advance()

template<class COORDINATES, class TRAVERSAL = typename default_traversal <tuple_size<COORDINATES>::value>::type>
gid_type stapl::implicit_regular_mesh_domain< COORDINATES, TRAVERSAL >::advance ( gid_type const &  idx,
long const &  n 
) const

Advance an index idx by n positions in the domain.

Parameters
idxindex.
nnumber of positions.
Returns
advanced index.

◆ distance()

template<class COORDINATES, class TRAVERSAL = typename default_traversal <tuple_size<COORDINATES>::value>::type>
size_t stapl::implicit_regular_mesh_domain< COORDINATES, TRAVERSAL >::distance ( gid_type const &  i0,
gid_type const &  i1 
) const

Return the positive distance between two indices based on the domain order.

Parameters
i0first index.
i1second index.
Returns
distance between i0 and i1.

◆ linearize()

template<class COORDINATES, class TRAVERSAL = typename default_traversal <tuple_size<COORDINATES>::value>::type>
gid_type stapl::implicit_regular_mesh_domain< COORDINATES, TRAVERSAL >::linearize ( tuple_type const &  t1) const

Linearize a tuple index based on the domain.

Parameters
t1tuple index.
Returns
linearized index.

◆ reverse_linearize()

template<class COORDINATES, class TRAVERSAL = typename default_traversal <tuple_size<COORDINATES>::value>::type>
tuple_type stapl::implicit_regular_mesh_domain< COORDINATES, TRAVERSAL >::reverse_linearize ( gid_type const &  id) const

Reverse linearize an index based on the domain.

Parameters
idindex.
Returns
tuple index.

◆ operator &()

template<class COORDINATES, class TRAVERSAL = typename default_traversal <tuple_size<COORDINATES>::value>::type>
implicit_regular_mesh_domain stapl::implicit_regular_mesh_domain< COORDINATES, TRAVERSAL >::operator& ( implicit_regular_mesh_domain< COORDINATES, TRAVERSAL > const &  other)

Intersect the domain with another domain.

Parameters
otherother domain.
Returns
domain resulting from the intersection.

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