Gromacs  2022.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions
gmx::layout_right::mapping< Extents > Class Template Reference

#include <gromacs/mdspan/layouts.h>

Description

template<class Extents>
class gmx::layout_right::mapping< Extents >

Mapping from multidimensional indices within extents to 1D index.

Template Parameters
Extentsthe extents of the multidimensional integers for the mapping.

Public Types

using index_type = ptrdiff_t
 exposing the type of indices
 
using extents_type = Extents
 exposing the type of the extents
 

Public Member Functions

constexpr mapping () noexcept=default
 Default constructor.
 
constexpr mapping (mapping &&) noexcept=default
 Default move constructor.
 
constexpr mapping (const mapping &) noexcept=default
 Default copy constructor.
 
mappingoperator= (mapping &&) noexcept=default
 Default move assignment.
 
mappingoperator= (const mapping &) noexcept=default
 Default copy assignment.
 
constexpr mapping (const Extents &ext) noexcept
 Construct mapping, setting extents. More...
 
constexpr const Extents & extents () const noexcept
 Return the extents. More...
 
constexpr index_type required_span_size () const noexcept
 Return the size of the underlying one-dimensional data structure, so that the mapping is always valid. More...
 
template<class... Indices>
std::enable_if_t< sizeof...(Indices)==Extents::rank(),
index_type > constexpr 
operator() (Indices...indices) const noexcept
 Map the multidimensional indices to 1D. Requires number of indicies have the same dimensionality as the mapping. More...
 
constexpr bool is_unique () const noexcept
 Report that this mapping is unique.
 
constexpr bool is_contiguous () const noexcept
 Report that this mapping is contiguous.
 
constexpr bool is_strided () const noexcept
 Report that this mapping is strided.
 
constexpr index_type stride (const size_t R) const noexcept
 Return the stride of dimension r. More...
 

Static Public Member Functions

static constexpr bool is_always_unique () noexcept
 Report that this mapping is always unique.
 
static constexpr bool is_always_contiguous () noexcept
 Report that this mapping is always contiguous.
 
static constexpr bool is_always_strided () noexcept
 Report that this mapping is always strided.
 

Constructor & Destructor Documentation

template<class Extents >
constexpr gmx::layout_right::mapping< Extents >::mapping ( const Extents &  ext)
inlinenoexcept

Construct mapping, setting extents.

Parameters
[in]extthe extents

Member Function Documentation

template<class Extents >
constexpr const Extents& gmx::layout_right::mapping< Extents >::extents ( ) const
inlinenoexcept

Return the extents.

Returns
extents
template<class Extents >
template<class... Indices>
std::enable_if_t<sizeof...(Indices) == Extents::rank(), index_type> constexpr gmx::layout_right::mapping< Extents >::operator() ( Indices...  indices) const
inlinenoexcept

Map the multidimensional indices to 1D. Requires number of indicies have the same dimensionality as the mapping.

Template Parameters
Indicestype of the indices to be mapped
Parameters
[in]indicesthe indices to be mapped
Returns
One-dimensional integer index.
template<class Extents >
constexpr index_type gmx::layout_right::mapping< Extents >::required_span_size ( ) const
inlinenoexcept

Return the size of the underlying one-dimensional data structure, so that the mapping is always valid.

Returns
number of span elements
template<class Extents >
constexpr index_type gmx::layout_right::mapping< Extents >::stride ( const size_t  R) const
inlinenoexcept

Return the stride of dimension r.

Parameters
[in]Rrank of the stride to be queried.
Returns
the stride along dimension r.

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