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

◆ const_pointer

◆ const_reference

◆ container_type

◆ element_type

◆ extents_type

◆ index_type

◆ layout_type

◆ mapping_type

◆ mdspan_type

◆ pointer

◆ rank_type

◆ reference

◆ size_type

◆ value_type

Constructor & Destructor Documentation

◆ mdarray() [1/12]

◆ mdarray() [2/12]

◆ mdarray() [3/12]

◆ mdarray() [4/12]

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)
inlineexplicitconstexpr

◆ mdarray() [5/12]

◆ mdarray() [6/12]

◆ mdarray() [7/12]

◆ mdarray() [8/12]

◆ mdarray() [9/12]

◆ mdarray() [10/12]

◆ mdarray() [11/12]

◆ mdarray() [12/12]

Member Function Documentation

◆ container_data() [1/2]

constexpr auto container_data ( ) -> pointer
inlineconstexpr

◆ container_data() [2/2]

constexpr auto container_data ( ) const -> const_pointer
inlineconstexpr

◆ container_size()

constexpr auto container_size ( ) const
inlineconstexpr

◆ empty()

constexpr auto empty ( ) const -> bool
inlineconstexprnoexcept

◆ extent()

◆ extents()

◆ extract_container()

constexpr auto extract_container ( ) && -> container_type&&
inlineconstexpr

◆ is_always_exhaustive()

static constexpr auto is_always_exhaustive ( ) -> bool
inlinestaticconstexpr

◆ is_always_strided()

static constexpr auto is_always_strided ( ) -> bool
inlinestaticconstexpr

◆ is_always_unique()

static constexpr auto is_always_unique ( ) -> bool
inlinestaticconstexpr

◆ is_exhaustive()

constexpr auto is_exhaustive ( ) const -> bool
inlineconstexpr

◆ is_strided()

constexpr auto is_strided ( ) const -> bool
inlineconstexpr

◆ is_unique()

constexpr auto is_unique ( ) const -> bool
inlineconstexpr

◆ mapping()

constexpr auto mapping ( ) const -> mapping_type const&
inlineconstexpr

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

template<typename OtherElement , typename OtherExtents , typename OtherLayout , typename OtherAccessor >
constexpr operator mdspan< OtherElement, OtherExtents, OtherLayout, OtherAccessor > ( )
inlineconstexpr

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

template<typename OtherElement , typename OtherExtents , typename OtherLayout , typename OtherAccessor >
constexpr operator mdspan< OtherElement, OtherExtents, OtherLayout, OtherAccessor > ( ) const
inlineconstexpr

◆ operator()() [1/2]

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
inlineconstexpr

◆ operator()() [2/2]

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
inlineconstexpr

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ operator[]() [1/4]

◆ operator[]() [2/4]

◆ operator[]() [3/4]

◆ operator[]() [4/4]

◆ rank()

◆ rank_dynamic()

static constexpr auto rank_dynamic ( ) -> rank_type
inlinestaticconstexprnoexcept

◆ size()

constexpr auto size ( ) const -> size_type
inlineconstexpr

◆ static_extent()

static constexpr auto static_extent ( rank_type  r) -> size_t
inlinestaticconstexprnoexcept

◆ stride()

constexpr auto stride ( size_t  r) const -> index_type
inlineconstexpr

◆ to_mdspan() [1/2]

◆ to_mdspan() [2/2]

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>
inlineconstexpr

Friends And Related Symbol Documentation

◆ swap


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