DUNE PDELab (git)

Dune::Std::layout_stride::mapping< Extents > Class Template Reference

A layout mapping where the strides are user-defined. More...

#include <dune/common/std/layout_stride.hh>

Public Member Functions

constexpr mapping () noexcept
 The default construction initializes the strides from layout_right.
 
constexpr mapping (const mapping &) noexcept=default
 Copy constructor for the mapping.
 
template<class OtherIndexType , std::enable_if_t< std::is_convertible_v< const OtherIndexType &, index_type >, int > = 0, std::enable_if_t< std::is_nothrow_constructible_v< index_type, const OtherIndexType & >, int > = 0>
constexpr mapping (const extents_type &e, const std::array< OtherIndexType, rank_ > &s) noexcept
 Construct the mapping from given extents and strides.
 
template<class OtherIndexType , std::enable_if_t< std::is_convertible_v< const OtherIndexType &, index_type >, int > = 0, std::enable_if_t< std::is_nothrow_constructible_v< index_type, const OtherIndexType & >, int > = 0>
constexpr mapping (const extents_type &e, const span< OtherIndexType, rank_ > &s) noexcept
 Construct the mapping from given extents and strides.
 
template<class M , std::enable_if_t<(M::extents_type::rank()==extents_type::rank()), int > = 0, std::enable_if_t<(M::is_always_unique()), int > = 0, std::enable_if_t<(M::is_always_strided()), int > = 0, decltype(std::declval< M >().extents(), bool{}) = true, decltype(std::declval< M >().stride(std::declval< rank_type >()), bool{}) = true>
constexpr mapping (const M &m) noexcept
 Construct the mapping from another mapping with different extents and different strides.
 
constexpr mappingoperator= (const mapping &) noexcept=default
 Copy-assignment for the mapping.
 
constexpr index_type required_span_size () const noexcept
 Return the sum 1 + (E(0)-1)*S(0) + (E(1)-1)*S(1) + ...
 
template<class... Indices, std::enable_if_t<(sizeof...(Indices)==rank_), int > = 0, std::enable_if_t<(std::is_convertible_v< Indices, index_type > &&...), int > = 0, std::enable_if_t<(std::is_nothrow_constructible_v< index_type, Indices > &&...), int > = 0>
constexpr index_type operator() (Indices... ii) const noexcept
 Compute the offset by folding with index-array with the strides array.
 
constexpr index_type operator() () const noexcept
 The default offset for rank-0 tensors is 0.
 
constexpr const strides_type & strides () const noexcept
 Get the array of all strides.
 
template<class E = extents_type, std::enable_if_t<(E::rank() > 0), int > = 0>
constexpr index_type stride (rank_type i) const noexcept
 Get the single stride i
 

Detailed Description

template<class Extents>
class Dune::Std::layout_stride::mapping< Extents >

A layout mapping where the strides are user-defined.


The documentation for this class was generated from the following files:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)