Gromacs  2024.4
 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, E0, StaticExtents...> Struct Template Reference

#include <gromacs/mdspan/extents.h>

Description

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

Enable querying extent of specific rank by splitting a static extents 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

constexpr extents_analyse ()
 Trivial constructor.
 
template<class... DynamicExtents>
constexpr extents_analyse (DynamicExtents...de)
 Construction from dynamic extents hands the extents down to the next extents analysis of lower rank. More...
 
template<std::size_t Rank>
constexpr 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. This extent is static, so hand down query to the next extent analysis. 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.
 

Constructor & Destructor Documentation

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

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

Parameters
[in]dedynamic extents
template<int R, std::ptrdiff_t E0, std::ptrdiff_t... StaticExtents>
template<std::size_t Rank>
constexpr gmx::detail::extents_analyse< R, E0, 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 E0, std::ptrdiff_t... StaticExtents>
constexpr std::ptrdiff_t gmx::detail::extents_analyse< R, E0, 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 E0, std::ptrdiff_t... StaticExtents>
static constexpr std::size_t gmx::detail::extents_analyse< R, E0, StaticExtents...>::rank ( )
inlinestaticnoexcept

Accumulate the total rank from all extents.

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

Accumulate the dynamic rank from all extents. This extent is static, so hand down query to the next extent analysis.

Returns
the dynamic rank of the next extent analysis.
template<int R, std::ptrdiff_t E0, std::ptrdiff_t... StaticExtents>
static constexpr std::ptrdiff_t gmx::detail::extents_analyse< R, E0, 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: