Gromacs  2024.3
 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 | Public Attributes
gmx::detail::extents_analyse< R, dynamic_extent, StaticExtents...> Struct Template Reference

#include <gromacs/mdspan/extents.h>

Description

template<int R, std::ptrdiff_t... StaticExtents>
struct gmx::detail::extents_analyse< R, dynamic_extent, StaticExtents...>

Enable querying extent of specific rank by splitting a dynamic extent off the variadic template arguments.

Public Types

using next_extents_analyse = extents_analyse< R-1, StaticExtents...>
 The extent analysis of the next lower rank.
 

Public Member Functions

 extents_analyse ()
 Trivial constructor.
 
template<class... DynamicExtents>
 extents_analyse (std::ptrdiff_t E, DynamicExtents...de)
 Construction from dynamic extents hands the extents down to the next extents analysis of lower rank. More...
 
template<std::size_t Rank>
 extents_analyse (const std::array< std::ptrdiff_t, Rank > &de, const std::size_t r)
 Construct from an array of dynamic extentes and rank. Hand down the dynamic rank parameters to the next extents analysis rank. More...
 
template<std::ptrdiff_t... OtherStaticExtents>
 extents_analyse (extents_analyse< R, OtherStaticExtents...> rhs)
 Copy constructor.
 
template<std::ptrdiff_t... OtherStaticExtents>
extents_analyseoperator= (extents_analyse< R, OtherStaticExtents...> rhs)
 Assignment operator.
 
constexpr std::ptrdiff_t extent (const std::size_t r) const noexcept
 Report extent of dimension r. More...
 
constexpr auto sliced_extents () const noexcept
 Returns the extent with the first dimension sliced off.
 

Static Public Member Functions

static constexpr std::size_t rank () noexcept
 Accumulate the total rank from all extents. More...
 
static constexpr std::size_t rank_dynamic () noexcept
 Accumulate the dynamic rank from all extents. More...
 
static constexpr std::ptrdiff_t static_extent (const std::size_t r) noexcept
 Report the static extent of dimension r. More...
 

Public Attributes

next_extents_analyse next
 Store analysis of the next extent of next lower rank.
 
std::ptrdiff_t this_extent
 The dynamic extent of this rank.
 

Constructor & Destructor Documentation

template<int R, std::ptrdiff_t... StaticExtents>
template<class... DynamicExtents>
gmx::detail::extents_analyse< R, dynamic_extent, StaticExtents...>::extents_analyse ( std::ptrdiff_t  E,
DynamicExtents...  de 
)
inline

Construction from dynamic extents hands the extents down to the next extents analysis of lower rank.

Parameters
[in]Ethe dynamic extent of this rank.
[in]dedynamic extents
template<int R, std::ptrdiff_t... StaticExtents>
template<std::size_t Rank>
gmx::detail::extents_analyse< R, dynamic_extent, StaticExtents...>::extents_analyse ( const std::array< std::ptrdiff_t, Rank > &  de,
const std::size_t  r 
)
inline

Construct from an array of dynamic extentes and rank. Hand down the dynamic rank parameters to the next extents analysis rank.

Parameters
[in]dedynamic extents
[in]rrank to read from the dynamic extent

Member Function Documentation

template<int R, std::ptrdiff_t... StaticExtents>
constexpr std::ptrdiff_t gmx::detail::extents_analyse< R, dynamic_extent, StaticExtents...>::extent ( const std::size_t  r) const
inlinenoexcept

Report extent of dimension r.

Parameters
[in]rthe dimension to query
Returns
the extent in dimension r.
template<int R, std::ptrdiff_t... StaticExtents>
static constexpr std::size_t gmx::detail::extents_analyse< R, dynamic_extent, StaticExtents...>::rank ( )
inlinestaticnoexcept

Accumulate the total rank from all extents.

Returns
incremented rank of the next extent
template<int R, std::ptrdiff_t... StaticExtents>
static constexpr std::size_t gmx::detail::extents_analyse< R, dynamic_extent, StaticExtents...>::rank_dynamic ( )
inlinestaticnoexcept

Accumulate the dynamic rank from all extents.

Returns
the dynamic rank of the next extent analysis.
template<int R, std::ptrdiff_t... StaticExtents>
static constexpr std::ptrdiff_t gmx::detail::extents_analyse< R, dynamic_extent, StaticExtents...>::static_extent ( const std::size_t  r)
inlinestaticnoexcept

Report the static extent of dimension r.

Parameters
[in]rthe dimension to query
Returns
the static extent in dimension r.

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