STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Public Attributes | Static Public Attributes
stapl::nd_linearize< GID, Traversal > Struct Template Reference

Translates an n-dimensional gid to a 1-dimensional linearization, based on the given Traversal order. More...

Public Member Functions

 nd_linearize (size_type size)
 
 nd_linearize (size_type size, size_type first)
 
 nd_linearize (nd_reverse_linearize< GID, Traversal > const &other)
 
template<std::size_t SliceIndex>
std::pair< std::size_t, typename detail::slice_result< SliceIndex, Traversal, GID >::type > slice (size_t const &idx)
 Slice a single index of the multidimensional space, fixing its value to that of the passed idx parameters. Return an offset representing the effect of the slicing operation and a reduced rank linearizer for the remaining indices. More...
 
template<std::size_t FirstSlice, std::size_t SecondSlice, std::size_t... Slices, typename Fixed >
std::pair< std::size_t, decltype(std::declval< typename detail::slice_result< FirstSlice, Traversal, GID >::type >).template slice< detail::adjusted_slice(FirstSlice, SecondSlice), detail::adjusted_slice(FirstSlice, Slices)... > tuple_ops::heterogeneous_discard< tuple< std::integral_constant< size_t, 0 > > >std::declval< Fixed >))).second)> slice (Fixed const &fixed)
 Slice multiple indices of the multidimensional space. Recursively called with single slice signature above as base case.
 
template<typename Slices , typename Fixed >
auto slice (Fixed const &fixed) -> decltype(this->slice_impl(typename tuple_ops::to_index_sequence< typename tuple_ops::result_of::rearrange< Slices, typename detail::indices_of_most_significant< Slices, Traversal >::type >::type >::type(), fixed))
 Slice multiple indices of the multidimensional space. Specialization when Slices is a tuple of integral constants. More...
 
template<typename... Indices>
gid_type operator() (Indices const &... is) const
 Localize and then linearize the indices that are the components of an n-dimensional GID.
 
template<typename Indices = make_index_sequence<tuple_size<index_type>::value>>
gid_type operator() (index_type const &gid) const
 Localize and then linearize the n-dimensional GID provided.
 

Public Types

using traversal_type = Traversal
 
using index_type = GID
 
using gid_type = size_t
 
using size_type = index_type
 
using inverse = nd_reverse_linearize< GID, Traversal >
 
using is_bijective = std::true_type
 

Public Attributes

size_type m_size
 
size_type m_plane_sizes
 
size_type m_first
 
size_type m_original_size
 Original unreordered size kept to make slicing logic easier.
 
size_type m_original_first
 Original unreordered first index kept to make slicing logic easier.
 

Static Public Attributes

static constexpr size_t last_idx = tuple_size<size_type>::value - 1
 

Detailed Description

template<typename GID, typename Traversal>
struct stapl::nd_linearize< GID, Traversal >

Translates an n-dimensional gid to a 1-dimensional linearization, based on the given Traversal order.

Member Function Documentation

◆ slice() [1/2]

template<typename GID, typename Traversal>
template<std::size_t SliceIndex>
std::pair< std::size_t, typename detail::slice_result<SliceIndex,Traversal,GID>::type > stapl::nd_linearize< GID, Traversal >::slice ( size_t const &  idx)

Slice a single index of the multidimensional space, fixing its value to that of the passed idx parameters. Return an offset representing the effect of the slicing operation and a reduced rank linearizer for the remaining indices.

◆ slice() [2/2]

template<typename GID, typename Traversal>
template<typename Slices , typename Fixed >
auto stapl::nd_linearize< GID, Traversal >::slice ( Fixed const &  fixed) -> decltype(this->slice_impl(typename tuple_ops::to_index_sequence< typename tuple_ops::result_of::rearrange<Slices, typename detail::indices_of_most_significant<Slices, Traversal>::type >::type >::type(), fixed))

Slice multiple indices of the multidimensional space. Specialization when Slices is a tuple of integral constants.

When slicing multiple indices at a time, we first need to rearrange the slice dimensions to match the most significant dimensions of the traversal.

Template Parameters
SlicesTuple of integral constants
Parameters
fixedThe indices to fix in the slice

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