|
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
161 decltype(construct_container<C>(std::declval<std::size_t>(),std::declval<const value_type&>()), bool{}) = true>
204 template <class OtherElementType, class OtherExtents, class OtherLayoutPolicy, class OtherContainer,
207 std::enable_if_t<std::is_constructible_v<mapping_type,const typename OtherLayoutPolicy::template mapping<OtherExtents>&>, int> = 0>
210 !std::is_convertible_v<const typename OtherLayoutPolicy::template mapping<OtherExtents>&, mapping_type> ||
213 constexpr mdarray (const mdarray<OtherElementType,OtherExtents,OtherLayoutPolicy,OtherContainer>& other)
222 std::enable_if_t<std::is_constructible_v<mapping_type, const typename OtherLayoutPolicy::template mapping<OtherExtents>&>, int> = 0,
226 !std::is_convertible_v<const typename OtherLayoutPolicy::template mapping<OtherExtents>&, mapping_type> ||
229 constexpr mdarray (const mdspan<OtherElementType,OtherExtents,OtherLayoutPolicy,Accessor>& other)
263 std::enable_if_t<std::is_constructible_v<container_type, std::size_t, value_type, Alloc>, int> = 0>
458 constexpr const_reference operator[] (const std::array<Index,extents_type::rank()>& indices) const
495 static constexpr std::size_t static_extent (rank_type r) noexcept { return extents_type::static_extent(r); }
522 static constexpr bool is_always_exhaustive () noexcept { return mapping_type::is_always_exhaustive(); }
523 static constexpr bool is_always_strided () noexcept { return mapping_type::is_always_strided(); }
537 constexpr const_pointer container_data () const noexcept { return std::to_address(container_.begin()); }
582 std::is_assignable_v<mdspan_type, mdspan<element_type,extents_type,layout_type,AccessorPolicy>>, int> = 0>
586 return mdspan<element_type,extents_type,layout_type,AccessorPolicy>(container_data(), mapping(), a);
592 std::is_assignable_v<const_mdspan_type, mdspan<const element_type,extents_type,layout_type,AccessorPolicy>>, int> = 0>
596 return mdspan<const element_type,extents_type,layout_type,AccessorPolicy>(container_data(), mapping(), a);
610 -> mdarray<typename Container::value_type, Std::extents<IndexType, exts...>, layout_right, Container>;
614 -> mdarray<typename Container::value_type, typename Mapping::extents_type, typename Mapping::layout_type, Container>;
618 -> mdarray<typename Container::value_type, Std::extents<IndexType, exts...>, layout_right, Container>;
622 -> mdarray<typename Container::value_type, typename Mapping::extents_type, typename Mapping::layout_type, Container>;
630 -> mdarray<typename Container::value_type, Std::extents<IndexType, exts...>, layout_right, Container>;
634 -> mdarray<typename Container::value_type, typename Mapping::extents_type, typename Mapping::layout_type, Container>;
638 -> mdarray<typename Container::value_type, Std::extents<IndexType, exts...>, layout_right, Container>;
642 -> mdarray<typename Container::value_type, typename Mapping::extents_type, typename Mapping::layout_type, Container>;
656 typename decltype(std::declval<mdarray<Element, Extents, Layout, Container>>().to_mdspan())::element_type,
657 typename decltype(std::declval<mdarray<Element, Extents, Layout, Container>>().to_mdspan())::extents_type,
658 typename decltype(std::declval<mdarray<Element, Extents, Layout, Container>>().to_mdspan())::layout_type,
659 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:30
mdspan< const element_type, extents_type, layout_type > const_mdspan_type
Definition mdarray.hh:91
constexpr mdarray(const mapping_type &m, const container_type &c, const Alloc &a)
Construct from layout mapping, container and allocator.
Definition mdarray.hh:288
typename container_type::const_reference const_reference
Definition mdarray.hh:96
constexpr mdarray(const mapping_type &m, container_type &&c)
Construct from layout mapping and the storage container.
Definition mdarray.hh:194
constexpr mdarray(const E &e, const container_type &c)
Construct from extents and the storage container.
Definition mdarray.hh:174
static constexpr bool is_always_exhaustive() noexcept
Definition mdarray.hh:522
constexpr mdspan< const element_type, extents_type, layout_type, AccessorPolicy > to_mdspan(const AccessorPolicy &a=AccessorPolicy{}) const
Conversion function to mdspan.
Definition mdarray.hh:594
constexpr index_type stride(rank_type r) const
The stride along the specified dimension.
Definition mdarray.hh:516
constexpr index_type extent(rank_type r) const noexcept
Number of elements in the r'th dimension of the tensor.
Definition mdarray.hh:498
constexpr mdarray(const extents_type &e, const Alloc &a)
Construct from the extents of the array and allocator.
Definition mdarray.hh:243
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:495
constexpr mdarray(const mdspan< OtherElementType, OtherExtents, OtherLayoutPolicy, Accessor > &other)
Converting constructor from mdspan.
Definition mdarray.hh:229
typename layout_type::template mapping< extents_type > mapping_type
Definition mdarray.hh:84
constexpr const_pointer container_data() const noexcept
Direct access to the underlying const data in the container.
Definition mdarray.hh:537
constexpr mdarray(const extents_type &e, const value_type &v)
Construct from extents and initial value.
Definition mdarray.hh:155
constexpr mdarray(const mapping_type &m, const Alloc &a)
Construct from the layout mapping of the array and allocator.
Definition mdarray.hh:250
constexpr pointer container_data() noexcept
Direct access to the underlying data in the container.
Definition mdarray.hh:534
constexpr bool is_exhaustive() const noexcept
Definition mdarray.hh:526
decltype(std::to_address(std::declval< container_type >().cbegin())) const_pointer
Definition mdarray.hh:95
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:408
constexpr const extents_type & extents() const noexcept
Number of elements in all dimensions of the array,.
Definition mdarray.hh:468
constexpr mdarray(const mapping_type &m, const container_type &c)
Construct from layout mapping and the storage container.
Definition mdarray.hh:188
static constexpr bool is_always_unique() noexcept
Definition mdarray.hh:521
constexpr mdarray(const mapping_type &m, container_type &&c, const Alloc &a)
Construct from layout mapping, container and allocator.
Definition mdarray.hh:296
constexpr mdarray(const E &e, container_type &&c)
Construct from extents and the storage container.
Definition mdarray.hh:182
constexpr const container_type & container() const noexcept
The underlying storage container.
Definition mdarray.hh:474
constexpr std::size_t container_size() const
Size of the underlying container.
Definition mdarray.hh:510
static constexpr rank_type rank() noexcept
Number of dimensions of the array.
Definition mdarray.hh:489
constexpr bool empty() const noexcept
Check whether the index space is empty.
Definition mdarray.hh:513
constexpr mdarray(const extents_type &e, container_type &&c, const Alloc &a)
Construct from extents, container and allocator.
Definition mdarray.hh:280
mdspan< element_type, extents_type, layout_type > mdspan_type
Definition mdarray.hh:90
constexpr size_type size() const noexcept
Size of the multi-dimensional index space.
Definition mdarray.hh:501
decltype(std::to_address(std::declval< container_type >().begin())) pointer
Definition mdarray.hh:93
friend constexpr bool operator==(const mdarray &lhs, const mdarray &rhs) noexcept
Definition mdarray.hh:553
friend constexpr void swap(mdarray &x, mdarray &y) noexcept
Definition mdarray.hh:542
constexpr const mapping_type & mapping() const noexcept
Index mapping of a layout policy.
Definition mdarray.hh:471
constexpr mdarray(const mapping_type &m, const value_type &v, const Alloc &a)
Construct from layout mapping, initial value and allocator.
Definition mdarray.hh:264
constexpr mdarray(const extents_type &e, const value_type &v, const Alloc &a)
Construct from extents, initial value and allocator.
Definition mdarray.hh:257
constexpr mdspan< element_type, extents_type, layout_type, AccessorPolicy > to_mdspan(const AccessorPolicy &a=AccessorPolicy{})
Conversion function to mdspan.
Definition mdarray.hh:584
constexpr container_type && extract_container() &&noexcept
Move the container out of the mdarray.
Definition mdarray.hh:482
constexpr mdarray(const extents_type &e, const container_type &c, const Alloc &a)
Construct from extents, container and allocator.
Definition mdarray.hh:272
static constexpr rank_type rank_dynamic() noexcept
Number of dimension with dynamic size.
Definition mdarray.hh:492
constexpr reference operator()(Indices... indices)
Access element at position (i0,i1,...)
Definition mdarray.hh:363
constexpr mdarray(const extents_type &e)
Construct from the extents of the array.
Definition mdarray.hh:138
constexpr mdarray(IndexTypes... exts)
Construct from the dynamic extents.
Definition mdarray.hh:133
static constexpr bool is_always_strided() noexcept
Definition mdarray.hh:523
constexpr index_type extent(rank_type r) const noexcept
Number of elements in the r'th dimension of the tensor.
Definition mdspan.hh:276
constexpr size_type size() const noexcept
The number of elements accessible by this multi-dimensional span.
Definition mdspan.hh:279
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