tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
mdarray< ElementType, Extents, LayoutPolicy, Container > Struct Template Reference

#include <mdarray.hpp>

Public Types

using const_mdspan_type = mdspan<element_type const, extents_type, layout_type>
 
using const_pointer = decltype(etl::to_address(etl::declval<container_type>().cbegin()))
 
using const_reference = typename container_type::const_reference
 
using container_type = Container
 
using element_type = ElementType
 
using extents_type = Extents
 
using index_type = typename Extents::index_type
 
using layout_type = LayoutPolicy
 
using mapping_type = typename layout_type::template mapping<extents_type>
 
using mdspan_type = mdspan<element_type, extents_type, layout_type>
 
using pointer = decltype(etl::to_address(etl::declval<container_type>().begin()))
 
using rank_type = typename Extents::rank_type
 
using reference = typename container_type::reference
 
using size_type = typename Extents::size_type
 
using value_type = element_type
 

Public Member Functions

constexpr mdarray ()=default
 
constexpr mdarray (extents_type const &ext)
 
constexpr mdarray (extents_type const &ext, container_type &&c)
 
constexpr mdarray (extents_type const &ext, container_type const &c)
 
constexpr mdarray (extents_type const &ext, value_type const &val)
 
constexpr mdarray (mapping_type const &m)
 
constexpr mdarray (mapping_type const &m, container_type &&c)
 
constexpr mdarray (mapping_type const &m, container_type const &c)
 
constexpr mdarray (mapping_type const &m, value_type const &val)
 
constexpr mdarray (mdarray &&rhs)=default
 
constexpr mdarray (mdarray const &rhs)=default
 
template<typename... OtherIndexTypes>
requires ( (is_convertible_v<OtherIndexTypes, index_type> and ...) and (is_nothrow_constructible_v<index_type, OtherIndexTypes> and ...) and (is_constructible_v<extents_type, OtherIndexTypes...>) and (is_constructible_v<mapping_type, extents_type>) and (array_or_constructible_from<Container, size_t>) )
constexpr mdarray (OtherIndexTypes... exts)
 
constexpr auto container_data () -> pointer
 
constexpr auto container_data () const -> const_pointer
 
constexpr auto container_size () const
 
constexpr auto empty () const noexcept -> bool
 
constexpr auto extent (rank_type r) const noexcept -> index_type
 
constexpr auto extents () const -> extents_type const &
 
constexpr auto extract_container () &&-> container_type &&
 
constexpr auto is_exhaustive () const -> bool
 
constexpr auto is_strided () const -> bool
 
constexpr auto is_unique () const -> bool
 
constexpr auto mapping () const -> mapping_type const &
 
template<typename OtherElement, typename OtherExtents, typename OtherLayout, typename OtherAccessor>
constexpr operator mdspan< OtherElement, OtherExtents, OtherLayout, OtherAccessor > ()
 
template<typename OtherElement, typename OtherExtents, typename OtherLayout, typename OtherAccessor>
constexpr operator mdspan< OtherElement, OtherExtents, OtherLayout, OtherAccessor > () const
 
template<typename... OtherIndexTypes>
requires ( (is_convertible_v<OtherIndexTypes, index_type> and ...) and (is_nothrow_constructible_v<index_type, OtherIndexTypes> and ...) and (sizeof...(OtherIndexTypes) == rank()) )
constexpr auto operator() (OtherIndexTypes... indices) -> reference
 
template<typename... OtherIndexTypes>
requires ( (is_convertible_v<OtherIndexTypes, index_type> and ...) and (is_nothrow_constructible_v<index_type, OtherIndexTypes> and ...) and (sizeof...(OtherIndexTypes) == rank()) )
constexpr auto operator() (OtherIndexTypes... indices) const -> const_reference
 
constexpr auto operator= (mdarray &&rhs) -> mdarray &=default
 
constexpr auto operator= (mdarray const &rhs) -> mdarray &=default
 
template<typename OtherIndexType>
requires (is_convertible_v<OtherIndexType const&, index_type> and is_nothrow_constructible_v<index_type, OtherIndexType const&>)
constexpr auto operator[] (array< OtherIndexType, rank()> const &indices) -> reference
 
template<typename OtherIndexType>
requires (is_convertible_v<OtherIndexType const&, index_type> and is_nothrow_constructible_v<index_type, OtherIndexType const&>)
constexpr auto operator[] (array< OtherIndexType, rank()> const &indices) const -> const_reference
 
template<typename OtherIndexType>
requires (is_convertible_v<OtherIndexType const&, index_type> and is_nothrow_constructible_v<index_type, OtherIndexType const&>)
constexpr auto operator[] (span< OtherIndexType, rank()> indices) -> reference
 
template<typename OtherIndexType>
requires (is_convertible_v<OtherIndexType const&, index_type> and is_nothrow_constructible_v<index_type, OtherIndexType const&>)
constexpr auto operator[] (span< OtherIndexType, rank()> indices) const -> const_reference
 
constexpr auto size () const -> size_type
 
constexpr auto stride (size_t r) const -> index_type
 
template<typename OtherAccessor = default_accessor<element_type>>
constexpr auto to_mdspan (OtherAccessor const &a=default_accessor< element_type >()) -> mdspan< element_type, extents_type, layout_type, OtherAccessor >
 
template<typename OtherAccessor = default_accessor<element_type const>>
constexpr auto to_mdspan (OtherAccessor const &a=default_accessor< element_type const >()) const -> mdspan< element_type const, extents_type, layout_type, OtherAccessor >
 

Static Public Member Functions

static constexpr auto is_always_exhaustive () -> bool
 
static constexpr auto is_always_strided () -> bool
 
static constexpr auto is_always_unique () -> bool
 
static constexpr auto rank () noexcept -> rank_type
 
static constexpr auto rank_dynamic () noexcept -> rank_type
 
static constexpr auto static_extent (rank_type r) noexcept -> size_t
 

Friends

constexpr void swap (mdarray &lhs, mdarray &rhs) noexcept
 

Member Typedef Documentation

◆ const_mdspan_type

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using const_mdspan_type = mdspan<element_type const, extents_type, layout_type>

◆ const_pointer

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using const_pointer = decltype(etl::to_address(etl::declval<container_type>().cbegin()))

◆ const_reference

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using const_reference = typename container_type::const_reference

◆ container_type

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using container_type = Container

◆ element_type

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using element_type = ElementType

◆ extents_type

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using extents_type = Extents

◆ index_type

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using index_type = typename Extents::index_type

◆ layout_type

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using layout_type = LayoutPolicy

◆ mapping_type

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using mapping_type = typename layout_type::template mapping<extents_type>

◆ mdspan_type

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using mdspan_type = mdspan<element_type, extents_type, layout_type>

◆ pointer

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using pointer = decltype(etl::to_address(etl::declval<container_type>().begin()))

◆ rank_type

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using rank_type = typename Extents::rank_type

◆ reference

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using reference = typename container_type::reference

◆ size_type

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using size_type = typename Extents::size_type

◆ value_type

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
using value_type = element_type

Constructor & Destructor Documentation

◆ mdarray() [1/12]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
mdarray ( )
constexprdefault

◆ mdarray() [2/12]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
mdarray ( mdarray< ElementType, Extents, LayoutPolicy, Container > const & rhs)
constexprdefault

◆ mdarray() [3/12]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
mdarray ( mdarray< ElementType, Extents, LayoutPolicy, Container > && rhs)
constexprdefault

◆ mdarray() [4/12]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
template<typename... OtherIndexTypes>
requires ( (is_convertible_v<OtherIndexTypes, index_type> and ...) and (is_nothrow_constructible_v<index_type, OtherIndexTypes> and ...) and (is_constructible_v<extents_type, OtherIndexTypes...>) and (is_constructible_v<mapping_type, extents_type>) and (array_or_constructible_from<Container, size_t>) )
mdarray ( OtherIndexTypes... exts)
inlineexplicitconstexpr

◆ mdarray() [5/12]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
mdarray ( extents_type const & ext)
inlineexplicitconstexpr

◆ mdarray() [6/12]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
mdarray ( mapping_type const & m)
inlineexplicitconstexpr

◆ mdarray() [7/12]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
mdarray ( extents_type const & ext,
value_type const & val )
inlineconstexpr

◆ mdarray() [8/12]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
mdarray ( mapping_type const & m,
value_type const & val )
inlineconstexpr

◆ mdarray() [9/12]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
mdarray ( extents_type const & ext,
container_type const & c )
inlineconstexpr

◆ mdarray() [10/12]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
mdarray ( mapping_type const & m,
container_type const & c )
inlineconstexpr

◆ mdarray() [11/12]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
mdarray ( extents_type const & ext,
container_type && c )
inlineconstexpr

◆ mdarray() [12/12]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
mdarray ( mapping_type const & m,
container_type && c )
inlineconstexpr

Member Function Documentation

◆ container_data() [1/2]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto container_data ( ) -> pointer
inlinenodiscardconstexpr

◆ container_data() [2/2]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto container_data ( ) const -> const_pointer
inlinenodiscardconstexpr

◆ container_size()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto container_size ( ) const
inlinenodiscardconstexpr

◆ empty()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto empty ( ) const -> bool
inlinenodiscardconstexprnoexcept

◆ extent()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto extent ( rank_type r) const -> index_type
inlinenodiscardconstexprnoexcept

◆ extents()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto extents ( ) const -> extents_type const&
inlinenodiscardconstexpr

◆ extract_container()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto extract_container ( ) && -> container_type&&
inlinenodiscardconstexpr

◆ is_always_exhaustive()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
constexpr auto is_always_exhaustive ( ) -> bool
inlinestaticnodiscardconstexpr

◆ is_always_strided()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
constexpr auto is_always_strided ( ) -> bool
inlinestaticnodiscardconstexpr

◆ is_always_unique()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
constexpr auto is_always_unique ( ) -> bool
inlinestaticnodiscardconstexpr

◆ is_exhaustive()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto is_exhaustive ( ) const -> bool
inlinenodiscardconstexpr

◆ is_strided()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto is_strided ( ) const -> bool
inlinenodiscardconstexpr

◆ is_unique()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto is_unique ( ) const -> bool
inlinenodiscardconstexpr

◆ mapping()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto mapping ( ) const -> mapping_type const&
inlinenodiscardconstexpr

◆ operator mdspan< OtherElement, OtherExtents, OtherLayout, OtherAccessor >() [1/2]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
template<typename OtherElement, typename OtherExtents, typename OtherLayout, typename OtherAccessor>
operator mdspan< OtherElement, OtherExtents, OtherLayout, OtherAccessor > ( )
inlinenodiscardconstexpr

◆ operator mdspan< OtherElement, OtherExtents, OtherLayout, OtherAccessor >() [2/2]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
template<typename OtherElement, typename OtherExtents, typename OtherLayout, typename OtherAccessor>
operator mdspan< OtherElement, OtherExtents, OtherLayout, OtherAccessor > ( ) const
inlinenodiscardconstexpr

◆ operator()() [1/2]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
template<typename... OtherIndexTypes>
requires ( (is_convertible_v<OtherIndexTypes, index_type> and ...) and (is_nothrow_constructible_v<index_type, OtherIndexTypes> and ...) and (sizeof...(OtherIndexTypes) == rank()) )
auto operator() ( OtherIndexTypes... indices) -> reference
inlinenodiscardconstexpr

◆ operator()() [2/2]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
template<typename... OtherIndexTypes>
requires ( (is_convertible_v<OtherIndexTypes, index_type> and ...) and (is_nothrow_constructible_v<index_type, OtherIndexTypes> and ...) and (sizeof...(OtherIndexTypes) == rank()) )
auto operator() ( OtherIndexTypes... indices) const -> const_reference
inlinenodiscardconstexpr

◆ operator=() [1/2]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto operator= ( mdarray< ElementType, Extents, LayoutPolicy, Container > && rhs) -> mdarray &=default
constexprdefault

◆ operator=() [2/2]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto operator= ( mdarray< ElementType, Extents, LayoutPolicy, Container > const & rhs) -> mdarray &=default
constexprdefault

◆ operator[]() [1/4]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
template<typename OtherIndexType>
requires (is_convertible_v<OtherIndexType const&, index_type> and is_nothrow_constructible_v<index_type, OtherIndexType const&>)
auto operator[] ( array< OtherIndexType, rank()> const & indices) -> reference
inlinenodiscardconstexpr

◆ operator[]() [2/4]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
template<typename OtherIndexType>
requires (is_convertible_v<OtherIndexType const&, index_type> and is_nothrow_constructible_v<index_type, OtherIndexType const&>)
auto operator[] ( array< OtherIndexType, rank()> const & indices) const -> const_reference
inlinenodiscardconstexpr

◆ operator[]() [3/4]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
template<typename OtherIndexType>
requires (is_convertible_v<OtherIndexType const&, index_type> and is_nothrow_constructible_v<index_type, OtherIndexType const&>)
auto operator[] ( span< OtherIndexType, rank()> indices) -> reference
inlinenodiscardconstexpr

◆ operator[]() [4/4]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
template<typename OtherIndexType>
requires (is_convertible_v<OtherIndexType const&, index_type> and is_nothrow_constructible_v<index_type, OtherIndexType const&>)
auto operator[] ( span< OtherIndexType, rank()> indices) const -> const_reference
inlinenodiscardconstexpr

◆ rank()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
constexpr auto rank ( ) -> rank_type
inlinestaticnodiscardconstexprnoexcept

◆ rank_dynamic()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
constexpr auto rank_dynamic ( ) -> rank_type
inlinestaticnodiscardconstexprnoexcept

◆ size()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto size ( ) const -> size_type
inlinenodiscardconstexpr

◆ static_extent()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
constexpr auto static_extent ( rank_type r) -> size_t
inlinestaticnodiscardconstexprnoexcept

◆ stride()

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
auto stride ( size_t r) const -> index_type
inlinenodiscardconstexpr

◆ to_mdspan() [1/2]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
template<typename OtherAccessor = default_accessor<element_type>>
auto to_mdspan ( OtherAccessor const & a = default_accessor<element_type>()) -> mdspan<element_type, extents_type, layout_type, OtherAccessor>
inlinenodiscardconstexpr

◆ to_mdspan() [2/2]

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
template<typename OtherAccessor = default_accessor<element_type const>>
auto to_mdspan ( OtherAccessor const & a = default_accessor<element_type const>()) const -> mdspan<element_type const, extents_type, layout_type, OtherAccessor>
inlinenodiscardconstexpr

Friends And Related Symbol Documentation

◆ swap

template<typename ElementType, typename Extents, typename LayoutPolicy, typename Container>
void swap ( mdarray< ElementType, Extents, LayoutPolicy, Container > & lhs,
mdarray< ElementType, Extents, LayoutPolicy, Container > & rhs )
friend

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