|
dune-common 2.12-git
|
Loading...
Searching...
No Matches
mdarray.hh
Go to the documentation of this file.
3// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
163 decltype(construct_container<C>(std::declval<std::size_t>(),std::declval<const value_type&>()), bool{}) = true>
206 template <class OtherElementType, class OtherExtents, class OtherLayoutPolicy, class OtherContainer,
209 std::enable_if_t<std::is_constructible_v<mapping_type,const typename OtherLayoutPolicy::template mapping<OtherExtents>&>, int> = 0>
212 !std::is_convertible_v<const typename OtherLayoutPolicy::template mapping<OtherExtents>&, mapping_type> ||
215 constexpr mdarray (const mdarray<OtherElementType,OtherExtents,OtherLayoutPolicy,OtherContainer>& other)
224 std::enable_if_t<std::is_constructible_v<mapping_type, const typename OtherLayoutPolicy::template mapping<OtherExtents>&>, int> = 0,
228 !std::is_convertible_v<const typename OtherLayoutPolicy::template mapping<OtherExtents>&, mapping_type> ||
231 constexpr mdarray (const mdspan<OtherElementType,OtherExtents,OtherLayoutPolicy,Accessor>& other)
265 std::enable_if_t<std::is_constructible_v<container_type, std::size_t, value_type, Alloc>, int> = 0>
460 constexpr const_reference operator[] (const std::array<Index,extents_type::rank()>& indices) const
571 static constexpr std::size_t static_extent (rank_type r) noexcept { return extents_type::static_extent(r); }
598 static constexpr bool is_always_exhaustive () noexcept { return mapping_type::is_always_exhaustive(); }
599 static constexpr bool is_always_strided () noexcept { return mapping_type::is_always_strided(); }
613 constexpr const_pointer container_data () const noexcept { return std::to_address(container_.begin()); }
658 std::is_assignable_v<mdspan_type, mdspan<element_type,extents_type,layout_type,AccessorPolicy>>, int> = 0>
662 return mdspan<element_type,extents_type,layout_type,AccessorPolicy>(container_data(), mapping(), a);
668 std::is_assignable_v<const_mdspan_type, mdspan<const element_type,extents_type,layout_type,AccessorPolicy>>, int> = 0>
672 return mdspan<const element_type,extents_type,layout_type,AccessorPolicy>(container_data(), mapping(), a);
686 -> mdarray<typename Container::value_type, Std::extents<IndexType, exts...>, layout_right, Container>;
690 -> mdarray<typename Container::value_type, typename Mapping::extents_type, typename Mapping::layout_type, Container>;
694 -> mdarray<typename Container::value_type, Std::extents<IndexType, exts...>, layout_right, Container>;
698 -> mdarray<typename Container::value_type, typename Mapping::extents_type, typename Mapping::layout_type, Container>;
706 -> mdarray<typename Container::value_type, Std::extents<IndexType, exts...>, layout_right, Container>;
710 -> mdarray<typename Container::value_type, typename Mapping::extents_type, typename Mapping::layout_type, Container>;
714 -> mdarray<typename Container::value_type, Std::extents<IndexType, exts...>, layout_right, Container>;
718 -> mdarray<typename Container::value_type, typename Mapping::extents_type, typename Mapping::layout_type, Container>;
732 typename decltype(std::declval<mdarray<Element, Extents, Layout, Container>>().to_mdspan())::element_type,
733 typename decltype(std::declval<mdarray<Element, Extents, Layout, Container>>().to_mdspan())::extents_type,
734 typename decltype(std::declval<mdarray<Element, Extents, Layout, Container>>().to_mdspan())::layout_type,
735 typename decltype(std::declval<mdarray<Element, Extents, Layout, Container>>().to_mdspan())::accessor_type>;
Utilities for reduction like operations on ranges.
decltype(auto) constexpr unpackIntegerSequence(F &&f, std::integer_sequence< I, i... > sequence)
Unpack an std::integer_sequence<I,i...> to std::integral_constant<I,i>...
Definition indices.hh:124
STL namespace.
Get the 'const' version of a reference to a mutable object.
Definition genericiterator.hh:87
Multidimensional index space with dynamic and static extents.
Definition extents.hh:55
A layout where the rightmost extent has stride 1, and strides increase right-to-left as the product o...
Definition fwd_layouts.hh:32
mdspan< const element_type, extents_type, layout_type > const_mdspan_type
Definition mdarray.hh:93
constexpr mdarray(const mapping_type &m, const container_type &c, const Alloc &a)
Construct from layout mapping, container and allocator.
Definition mdarray.hh:290
typename container_type::const_reference const_reference
Definition mdarray.hh:98
constexpr mdarray(const mapping_type &m, container_type &&c)
Construct from layout mapping and the storage container.
Definition mdarray.hh:196
constexpr mdarray(const E &e, const container_type &c)
Construct from extents and the storage container.
Definition mdarray.hh:176
static constexpr bool is_always_exhaustive() noexcept
Definition mdarray.hh:598
constexpr mdspan< const element_type, extents_type, layout_type, AccessorPolicy > to_mdspan(const AccessorPolicy &a=AccessorPolicy{}) const
Conversion function to mdspan.
Definition mdarray.hh:670
constexpr index_type stride(rank_type r) const
The stride along the specified dimension.
Definition mdarray.hh:592
constexpr index_type extent(rank_type r) const noexcept
Number of elements in the r'th dimension of the tensor.
Definition mdarray.hh:574
constexpr mdarray(const extents_type &e, const Alloc &a)
Construct from the extents of the array and allocator.
Definition mdarray.hh:245
static constexpr std::size_t static_extent(rank_type r) noexcept
Number of elements in the r'th dimension of the tensor.
Definition mdarray.hh:571
constexpr mdarray(const mdspan< OtherElementType, OtherExtents, OtherLayoutPolicy, Accessor > &other)
Converting constructor from mdspan.
Definition mdarray.hh:231
constexpr const_reference at(const std::array< Index, extents_type::rank()> &indices) const
Access element with bounds checking.
Definition mdarray.hh:532
typename layout_type::template mapping< extents_type > mapping_type
Definition mdarray.hh:86
constexpr const_pointer container_data() const noexcept
Direct access to the underlying const data in the container.
Definition mdarray.hh:613
constexpr mdarray(const extents_type &e, const value_type &v)
Construct from extents and initial value.
Definition mdarray.hh:157
constexpr mdarray(const mapping_type &m, const Alloc &a)
Construct from the layout mapping of the array and allocator.
Definition mdarray.hh:252
constexpr pointer container_data() noexcept
Direct access to the underlying data in the container.
Definition mdarray.hh:610
constexpr bool is_exhaustive() const noexcept
Definition mdarray.hh:602
decltype(std::to_address(std::declval< container_type >().cbegin())) const_pointer
Definition mdarray.hh:97
constexpr reference operator[](Index index)
Access specified element at position [i0] For a rank one mdarray, the operator[i] is added to support...
Definition mdarray.hh:410
constexpr const extents_type & extents() const noexcept
Number of elements in all dimensions of the array,.
Definition mdarray.hh:544
constexpr reference at(std::span< Index, extents_type::rank()> indices)
Access element with bounds checking.
Definition mdarray.hh:494
constexpr mdarray(const mapping_type &m, const container_type &c)
Construct from layout mapping and the storage container.
Definition mdarray.hh:190
static constexpr bool is_always_unique() noexcept
Definition mdarray.hh:597
constexpr mdarray(const mapping_type &m, container_type &&c, const Alloc &a)
Construct from layout mapping, container and allocator.
Definition mdarray.hh:298
constexpr mdarray(const E &e, container_type &&c)
Construct from extents and the storage container.
Definition mdarray.hh:184
constexpr const container_type & container() const noexcept
The underlying storage container.
Definition mdarray.hh:550
constexpr std::size_t container_size() const
Size of the underlying container.
Definition mdarray.hh:586
static constexpr rank_type rank() noexcept
Number of dimensions of the array.
Definition mdarray.hh:565
constexpr bool empty() const noexcept
Check whether the index space is empty.
Definition mdarray.hh:589
constexpr mdarray(const extents_type &e, container_type &&c, const Alloc &a)
Construct from extents, container and allocator.
Definition mdarray.hh:282
mdspan< element_type, extents_type, layout_type > mdspan_type
Definition mdarray.hh:92
constexpr size_type size() const noexcept
Size of the multi-dimensional index space.
Definition mdarray.hh:577
decltype(std::to_address(std::declval< container_type >().begin())) pointer
Definition mdarray.hh:95
friend constexpr bool operator==(const mdarray &lhs, const mdarray &rhs) noexcept
Definition mdarray.hh:629
friend constexpr void swap(mdarray &x, mdarray &y) noexcept
Definition mdarray.hh:618
constexpr const mapping_type & mapping() const noexcept
Index mapping of a layout policy.
Definition mdarray.hh:547
constexpr mdarray(const mapping_type &m, const value_type &v, const Alloc &a)
Construct from layout mapping, initial value and allocator.
Definition mdarray.hh:266
constexpr mdarray(const extents_type &e, const value_type &v, const Alloc &a)
Construct from extents, initial value and allocator.
Definition mdarray.hh:259
constexpr mdspan< element_type, extents_type, layout_type, AccessorPolicy > to_mdspan(const AccessorPolicy &a=AccessorPolicy{})
Conversion function to mdspan.
Definition mdarray.hh:660
constexpr reference at(Indices... indices)
Access element with bounds checking.
Definition mdarray.hh:471
constexpr container_type && extract_container() &&noexcept
Move the container out of the mdarray.
Definition mdarray.hh:558
constexpr mdarray(const extents_type &e, const container_type &c, const Alloc &a)
Construct from extents, container and allocator.
Definition mdarray.hh:274
constexpr reference at(const std::array< Index, extents_type::rank()> &indices)
Access element with bounds checking.
Definition mdarray.hh:520
static constexpr rank_type rank_dynamic() noexcept
Number of dimension with dynamic size.
Definition mdarray.hh:568
constexpr reference operator()(Indices... indices)
Access element at position (i0,i1,...)
Definition mdarray.hh:365
constexpr mdarray(const extents_type &e)
Construct from the extents of the array.
Definition mdarray.hh:140
constexpr mdarray(IndexTypes... exts)
Construct from the dynamic extents.
Definition mdarray.hh:135
constexpr const_reference at(std::span< Index, extents_type::rank()> indices) const
Access element with bounds checking.
Definition mdarray.hh:507
static constexpr bool is_always_strided() noexcept
Definition mdarray.hh:599
constexpr index_type extent(rank_type r) const noexcept
Number of elements in the r'th dimension of the tensor.
Definition mdspan.hh:315
constexpr size_type size() const noexcept
The number of elements accessible by this multi-dimensional span.
Definition mdspan.hh:318
T apply(T... args)
T declval(T... args)
T is_convertible_v
T swap(T... args)
T to_address(T... args)
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8