dune-common  2.11
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
Dune::Std::layout_right::mapping< Extents > Class Template Reference

A layout mapping where the rightmost extent has stride 1. More...

#include <dune/common/std/impl/fwd_layouts.hh>

Public Types

using extents_type = Extents
 
using size_type = typename extents_type::size_type
 
using rank_type = typename extents_type::rank_type
 
using index_type = typename extents_type::index_type
 
using layout_type = layout_right
 

Public Member Functions

constexpr mapping () noexcept=default
 The default construction is possible for default constructible extents. More...
 
constexpr mapping (const mapping &) noexcept=default
 Copy constructor for the mapping. More...
 
constexpr mapping (const extents_type &e) noexcept
 Construct the mapping with from given extents. More...
 
template<class OtherExtents , std::enable_if_t< std::is_constructible_v< extents_type, OtherExtents >, int > = 0>
constexpr mapping (const mapping< OtherExtents > &m) noexcept
 Construct the mapping from another mapping with a different extents type. More...
 
template<class OtherExtents , class E = extents_type>
constexpr mapping (const layout_left::mapping< OtherExtents > &m) noexcept
 Construct the mapping from a layout_left. More...
 
template<class OtherExtents , std::enable_if_t< std::is_constructible_v< extents_type, OtherExtents >, int > = 0>
constexpr mapping (const layout_stride::mapping< OtherExtents > &m)
 Construct the mapping from a layout_stride. More...
 
constexpr mappingoperator= (const mapping &) noexcept=default
 Copy-assignment for the mapping. More...
 
constexpr const extents_typeextents () const noexcept
 
constexpr index_type required_span_size () const noexcept
 
template<class... Indices, std::enable_if_t<(sizeof...(Indices)==extents_type::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< Indices, index_type > &&...), int > = 0>
constexpr index_type operator() (Indices... ii) const noexcept
 Compute the offset i3 + E(3)*(i2 + E(2)*(i1 + E(1)*i0)) More...
 
constexpr index_type operator() () const noexcept
 The default offset for rank-0 tensors is 0. More...
 
template<class E = extents_type, std::enable_if_t<(E::rank() > 0>
constexpr index_type stride (rank_type i) const noexcept
 The stride is the product of the extents E(n)*E(n-1)*...*E(i+1) More...
 

Static Public Member Functions

static constexpr bool is_always_unique () noexcept
 
static constexpr bool is_always_exhaustive () noexcept
 
static constexpr bool is_always_strided () noexcept
 
static constexpr bool is_unique () noexcept
 
static constexpr bool is_exhaustive () noexcept
 
static constexpr bool is_strided () noexcept
 

Friends

template<class >
class mapping
 
template<class OtherExtents >
constexpr bool operator== (const mapping &a, const mapping< OtherExtents > &b) noexcept
 

Detailed Description

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

A layout mapping where the rightmost extent has stride 1.

Member Typedef Documentation

◆ extents_type

template<class Extents>
using Dune::Std::layout_right::mapping< Extents >::extents_type = Extents

◆ index_type

template<class Extents>
using Dune::Std::layout_right::mapping< Extents >::index_type = typename extents_type::index_type

◆ layout_type

template<class Extents>
using Dune::Std::layout_right::mapping< Extents >::layout_type = layout_right

◆ rank_type

template<class Extents>
using Dune::Std::layout_right::mapping< Extents >::rank_type = typename extents_type::rank_type

◆ size_type

template<class Extents>
using Dune::Std::layout_right::mapping< Extents >::size_type = typename extents_type::size_type

Constructor & Destructor Documentation

◆ mapping() [1/6]

template<class Extents>
constexpr Dune::Std::layout_right::mapping< Extents >::mapping ( )
defaultnoexcept

The default construction is possible for default constructible extents.

◆ mapping() [2/6]

template<class Extents>
constexpr Dune::Std::layout_right::mapping< Extents >::mapping ( const mapping< Extents > &  )
defaultnoexcept

Copy constructor for the mapping.

◆ mapping() [3/6]

template<class Extents>
constexpr Dune::Std::layout_right::mapping< Extents >::mapping ( const extents_type e)
inlinenoexcept

Construct the mapping with from given extents.

◆ mapping() [4/6]

template<class Extents>
template<class OtherExtents , std::enable_if_t< std::is_constructible_v< extents_type, OtherExtents >, int > = 0>
constexpr Dune::Std::layout_right::mapping< Extents >::mapping ( const mapping< OtherExtents > &  m)
inlinenoexcept

Construct the mapping from another mapping with a different extents type.

◆ mapping() [5/6]

template<class Extents>
template<class OtherExtents , class E = extents_type>
constexpr Dune::Std::layout_right::mapping< Extents >::mapping ( const layout_left::mapping< OtherExtents > &  m)
inlinenoexcept

Construct the mapping from a layout_left.

◆ mapping() [6/6]

template<class Extents>
template<class OtherExtents , std::enable_if_t< std::is_constructible_v< extents_type, OtherExtents >, int > = 0>
constexpr Dune::Std::layout_right::mapping< Extents >::mapping ( const layout_stride::mapping< OtherExtents > &  m)
inline

Construct the mapping from a layout_stride.

Member Function Documentation

◆ extents()

template<class Extents>
constexpr const extents_type& Dune::Std::layout_right::mapping< Extents >::extents ( ) const
inlinenoexcept

◆ is_always_exhaustive()

template<class Extents>
static constexpr bool Dune::Std::layout_right::mapping< Extents >::is_always_exhaustive ( )
inlinestaticnoexcept

◆ is_always_strided()

template<class Extents>
static constexpr bool Dune::Std::layout_right::mapping< Extents >::is_always_strided ( )
inlinestaticnoexcept

◆ is_always_unique()

template<class Extents>
static constexpr bool Dune::Std::layout_right::mapping< Extents >::is_always_unique ( )
inlinestaticnoexcept

◆ is_exhaustive()

template<class Extents>
static constexpr bool Dune::Std::layout_right::mapping< Extents >::is_exhaustive ( )
inlinestaticnoexcept

◆ is_strided()

template<class Extents>
static constexpr bool Dune::Std::layout_right::mapping< Extents >::is_strided ( )
inlinestaticnoexcept

◆ is_unique()

template<class Extents>
static constexpr bool Dune::Std::layout_right::mapping< Extents >::is_unique ( )
inlinestaticnoexcept

◆ operator()() [1/2]

template<class Extents>
template<class... Indices, std::enable_if_t<(sizeof...(Indices)==extents_type::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< Indices, index_type > &&...), int > = 0>
constexpr index_type Dune::Std::layout_right::mapping< Extents >::operator() ( Indices...  ii) const
inlinenoexcept

Compute the offset i3 + E(3)*(i2 + E(2)*(i1 + E(1)*i0))

◆ operator()() [2/2]

template<class Extents>
constexpr index_type Dune::Std::layout_right::mapping< Extents >::operator() ( ) const
inlinenoexcept

The default offset for rank-0 tensors is 0.

◆ operator=()

template<class Extents>
constexpr mapping& Dune::Std::layout_right::mapping< Extents >::operator= ( const mapping< Extents > &  )
defaultnoexcept

Copy-assignment for the mapping.

◆ required_span_size()

template<class Extents>
constexpr index_type Dune::Std::layout_right::mapping< Extents >::required_span_size ( ) const
inlinenoexcept

◆ stride()

template<class Extents>
template<class E = extents_type, std::enable_if_t<(E::rank() > 0>
constexpr index_type Dune::Std::layout_right::mapping< Extents >::stride ( rank_type  i) const
inlinenoexcept

The stride is the product of the extents E(n)*E(n-1)*...*E(i+1)

Friends And Related Function Documentation

◆ mapping

template<class Extents>
template<class >
friend class mapping
friend

◆ operator==

template<class Extents>
template<class OtherExtents >
constexpr bool operator== ( const mapping< Extents > &  a,
const mapping< OtherExtents > &  b 
)
friend

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