DDC 0.16.0
Loading...
Searching...
No Matches
type_seq.hpp
1// Copyright (C) The DDC development team, see COPYRIGHT.md file
2//
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
7#include <cstddef>
8#include <limits>
9#include <tuple>
10#include <type_traits>
11#include <utility>
12
13#include <ddc/config.hpp>
14
15namespace ddc {
16
17/// @brief A compile-time sequence of types.
18///
19/// `TypeSeq` is used to represent an ordered collection of types at compile time.
20/// It is primarily intended for manipulating lists of tags or types in generic
21/// programming code.
22///
23/// The order of the types is significant for operations such as
24/// @ref type_seq_rank_v, @ref type_seq_element_t, and the sequence manipulation
25/// utilities.
26///
27/// @tparam Tags The types contained in the sequence.
28template <class... Tags>
29struct TypeSeq
30{
31};
32
33namespace detail {
34
36template <class... Tags>
37struct [[deprecated("Use `ddc::TypeSeq' instead")]] TypeSeq
38{
39};
40#endif
41
42template <class Tag>
43struct SingleType
44{
45};
46
47template <class QueryTagSeq, class TagSeq>
48struct TypeSeqRank
49{
50};
51
52template <class QueryTag>
53struct TypeSeqRank<SingleType<QueryTag>, ddc::TypeSeq<>>
54{
55 static constexpr bool present = false;
56 static constexpr std::size_t val = std::numeric_limits<std::size_t>::max();
57};
58
59template <class QueryTag, class... TagsTail>
60struct TypeSeqRank<SingleType<QueryTag>, ddc::TypeSeq<QueryTag, TagsTail...>>
61{
62 static constexpr bool present = true;
63 static constexpr std::size_t val = 0;
64};
65
66template <class QueryTag, class TagsHead, class... TagsTail>
67struct TypeSeqRank<SingleType<QueryTag>, ddc::TypeSeq<TagsHead, TagsTail...>>
68{
69 static constexpr bool present
70 = TypeSeqRank<SingleType<QueryTag>, ddc::TypeSeq<TagsTail...>>::present;
71 static constexpr std::size_t val
72 = present ? 1 + TypeSeqRank<SingleType<QueryTag>, ddc::TypeSeq<TagsTail...>>::val
73 : std::numeric_limits<std::size_t>::max();
74};
75
76template <class... QueryTags, class... Tags>
77struct TypeSeqRank<ddc::TypeSeq<QueryTags...>, ddc::TypeSeq<Tags...>>
78{
79 using ValSeq = std::index_sequence<TypeSeqRank<QueryTags, ddc::TypeSeq<Tags...>>::val...>;
80};
81
82template <std::size_t I, class TagSeq>
83struct TypeSeqElement
84{
85};
86
87template <std::size_t I, class... Tags>
88struct TypeSeqElement<I, ddc::TypeSeq<Tags...>>
89{
90 using type = std::tuple_element_t<I, std::tuple<Tags...>>;
91};
92
93/// R contains all elements in A that are not in B.
94/// Remark 1: This operation preserves the order from A.
95/// Remark 2: It is similar to the set difference in the set theory (R = A\\B).
96/// Example: A = [a, b, c], B = [z, c, y], R = [a, b]
97template <class TagSeqA, class TagSeqB, class TagSeqR>
98struct TypeSeqRemove
99{
100};
101
102template <class... TagsB, class... TagsR>
103struct TypeSeqRemove<ddc::TypeSeq<>, ddc::TypeSeq<TagsB...>, ddc::TypeSeq<TagsR...>>
104{
105 using type = ddc::TypeSeq<TagsR...>;
106};
107
108template <class HeadTagsA, class... TailTagsA, class... TagsB, class... TagsR>
109struct TypeSeqRemove<
110 ddc::TypeSeq<HeadTagsA, TailTagsA...>,
111 ddc::TypeSeq<TagsB...>,
112 ddc::TypeSeq<TagsR...>>
113 : std::conditional_t<
114 TypeSeqRank<detail::SingleType<HeadTagsA>, ddc::TypeSeq<TagsB...>>::present,
115 TypeSeqRemove<
116 ddc::TypeSeq<TailTagsA...>,
117 ddc::TypeSeq<TagsB...>,
118 ddc::TypeSeq<TagsR...>>,
119 TypeSeqRemove<
120 ddc::TypeSeq<TailTagsA...>,
121 ddc::TypeSeq<TagsB...>,
122 ddc::TypeSeq<TagsR..., HeadTagsA>>>
123{
124};
125
126/// R contains all elements in A and elements in B that are not in A.
127/// Remark 1: This operation preserves the order from A.
128/// Remark 2: It is similar to the set union in the set theory (R = AUB).
129/// Example: A = [a, b, c], B = [z, c, y], R = [a, b, c, z, y]
130template <class TagSeqA, class TagSeqB, class TagSeqR>
131struct TypeSeqMerge
132{
133};
134
135template <class... TagsA, class... TagsR>
136struct TypeSeqMerge<ddc::TypeSeq<TagsA...>, ddc::TypeSeq<>, ddc::TypeSeq<TagsR...>>
137{
138 using type = ddc::TypeSeq<TagsR...>;
139};
140
141template <class... TagsA, class HeadTagsB, class... TailTagsB, class... TagsR>
142struct TypeSeqMerge<
143 ddc::TypeSeq<TagsA...>,
144 ddc::TypeSeq<HeadTagsB, TailTagsB...>,
145 ddc::TypeSeq<TagsR...>>
146 : std::conditional_t<
147 TypeSeqRank<detail::SingleType<HeadTagsB>, ddc::TypeSeq<TagsA...>>::present,
148 TypeSeqMerge<
149 ddc::TypeSeq<TagsA...>,
150 ddc::TypeSeq<TailTagsB...>,
151 ddc::TypeSeq<TagsR...>>,
152 TypeSeqMerge<
153 ddc::TypeSeq<TagsA...>,
154 ddc::TypeSeq<TailTagsB...>,
155 ddc::TypeSeq<TagsR..., HeadTagsB>>>
156{
157};
158
159/// `type` contains all elements in A then all elements in B.
160/// Example: A = [a, b, c], B = [z, c, y], returned type [a, b, c, z, c, y]
161template <class TagSeqA, class TagSeqB>
162struct TypeSeqCat
163{
164};
165
166template <class... TagsA, class... TagsB>
167struct TypeSeqCat<ddc::TypeSeq<TagsA...>, ddc::TypeSeq<TagsB...>>
168{
169 using type = ddc::TypeSeq<TagsA..., TagsB...>;
170};
171
172/// A is replaced by element of C at same position than the first element of B equal to A.
173/// Remark : It may not be useful in its own, it is an helper for TypeSeqReplace
174template <class TagA, class TagSeqB, class TagSeqC>
175struct TypeSeqReplaceSingle
176{
177};
178
179template <class TagA>
180struct TypeSeqReplaceSingle<TagA, ddc::TypeSeq<>, ddc::TypeSeq<>>
181{
182 using type = TagA;
183};
184
185template <class TagA, class HeadTagsB, class... TailTagsB, class HeadTagsC, class... TailTagsC>
186struct TypeSeqReplaceSingle<
187 TagA,
188 ddc::TypeSeq<HeadTagsB, TailTagsB...>,
189 ddc::TypeSeq<HeadTagsC, TailTagsC...>>
190 : std::conditional_t<
191 std::is_same_v<TagA, HeadTagsB>,
192 TypeSeqReplaceSingle<HeadTagsC, ddc::TypeSeq<>, ddc::TypeSeq<>>,
193 TypeSeqReplaceSingle<TagA, ddc::TypeSeq<TailTagsB...>, ddc::TypeSeq<TailTagsC...>>>
194{
195};
196
197/// R contains all elements of A except those of B which are replaced by those of C.
198/// Remark : This operation preserves the orders.
199template <class TagSeqA, class TagSeqB, class TagSeqC, class TagSeqR>
200struct TypeSeqReplace
201{
202};
203
204template <class... TagsB, class... TagsC, class... TagsR>
205struct TypeSeqReplace<
206 ddc::TypeSeq<>,
207 ddc::TypeSeq<TagsB...>,
208 ddc::TypeSeq<TagsC...>,
209 ddc::TypeSeq<TagsR...>>
210{
211 using type = ddc::TypeSeq<TagsR...>;
212};
213
214template <class HeadTagsA, class... TailTagsA, class... TagsB, class... TagsC, class... TagsR>
215struct TypeSeqReplace<
216 ddc::TypeSeq<HeadTagsA, TailTagsA...>,
217 ddc::TypeSeq<TagsB...>,
218 ddc::TypeSeq<TagsC...>,
219 ddc::TypeSeq<TagsR...>>
220 : TypeSeqReplace<
221 ddc::TypeSeq<TailTagsA...>,
222 ddc::TypeSeq<TagsB...>,
223 ddc::TypeSeq<TagsC...>,
224 ddc::TypeSeq<
225 TagsR...,
226 typename TypeSeqReplaceSingle<
227 HeadTagsA,
228 ddc::TypeSeq<TagsB...>,
229 ddc::TypeSeq<TagsC...>>::type>>
230{
231};
232
233template <class T>
234struct ToTypeSeq
235{
236};
237
238template <class T, class TagSeq>
239struct Rebind
240{
241};
242
243} // namespace detail
244
245template <class TypeSeq>
247
248/// Returns the number of types in a @ref TypeSeq.
249template <class... Tags>
250constexpr std::size_t type_seq_size_v<TypeSeq<Tags...>> = sizeof...(Tags);
251
252template <class QueryTag, class TypeSeq>
254
255template <class QueryTag, class OTypeSeq>
256constexpr bool in_tags_v = false;
257
258template <class TypeSeq, class OTypeSeq>
259constexpr bool type_seq_contains_v = false;
260
261template <class TypeSeq>
262constexpr bool type_seq_is_unique_v = false;
263
264template <class TypeSeq, class B>
266
267template <class QueryTag, class... Tags>
268constexpr bool in_tags_v<QueryTag, TypeSeq<Tags...>>
269 = detail::TypeSeqRank<detail::SingleType<QueryTag>, TypeSeq<Tags...>>::present;
270
271template <class... Tags, class OTypeSeq>
272constexpr bool type_seq_contains_v<TypeSeq<Tags...>, OTypeSeq>
273 = (detail::TypeSeqRank<detail::SingleType<Tags>, OTypeSeq>::present && ...);
274
275template <class QueryTag, class... Tags>
276constexpr std::size_t type_seq_rank_v<QueryTag, TypeSeq<Tags...>>
277 = detail::TypeSeqRank<detail::SingleType<QueryTag>, TypeSeq<Tags...>>::val;
278
279template <std::size_t I, class TagSeq>
280using type_seq_element_t = detail::TypeSeqElement<I, TagSeq>::type;
281
282template <class TagSeqA, class TagSeqB>
283using type_seq_remove_t = detail::TypeSeqRemove<TagSeqA, TagSeqB, TypeSeq<>>::type;
284
285template <class TagSeqA, class TagSeqB>
286using type_seq_merge_t = detail::TypeSeqMerge<TagSeqA, TagSeqB, TagSeqA>::type;
287
288template <class TagSeqA, class TagSeqB>
289using type_seq_cat_t = detail::TypeSeqCat<TagSeqA, TagSeqB>::type;
290
291template <class TagSeqA, class TagSeqB, class TagSeqC>
292using type_seq_replace_t = detail::TypeSeqReplace<TagSeqA, TagSeqB, TagSeqC, TypeSeq<>>::type;
293
294template <class... Tags>
295constexpr bool type_seq_is_unique_v<TypeSeq<Tags...>>
296 = ((type_seq_size_v<type_seq_remove_t<TypeSeq<Tags...>, TypeSeq<Tags>>>
297 == sizeof...(Tags) - 1)
298 && ...);
299
300template <class T>
301using to_type_seq_t = detail::ToTypeSeq<T>::type;
302
303} // namespace ddc
friend class ChunkSpan
KOKKOS_FUNCTION constexpr ChunkCommon(ElementType *ptr, SupportType const &domain)
Constructs a new ChunkCommon from scratch.
KOKKOS_FUNCTION constexpr bool is_strided() const noexcept
KOKKOS_DEFAULTED_FUNCTION ~ChunkCommon() noexcept=default
KOKKOS_FUNCTION constexpr ElementType * data_handle() const
Access to the underlying allocation pointer.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon()=default
Empty ChunkCommon.
allocation_mdspan_type m_allocation_mdspan
The raw view of the data.
KOKKOS_FUNCTION constexpr SupportType domain() const noexcept
Provide access to the domain on which this chunk is defined.
static KOKKOS_FUNCTION constexpr bool is_always_strided() noexcept
KOKKOS_FUNCTION constexpr allocation_mdspan_type allocation_mdspan() const
Provide a modifiable view of the data.
KOKKOS_FUNCTION constexpr ChunkCommon(allocation_mdspan_type allocation_mdspan, SupportType const &domain) noexcept
Constructs a new ChunkCommon from scratch.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon(ChunkCommon const &other)=default
Constructs a new ChunkCommon by copy, yields a new view to the same data.
static KOKKOS_FUNCTION constexpr bool is_always_unique() noexcept
KOKKOS_FUNCTION constexpr DiscreteDomain< QueryDDims... > domain() const noexcept
Provide access to the domain on which this chunk is defined.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon & operator=(ChunkCommon const &other)=default
Copy-assigns a new value to this ChunkCommon, yields a new view to the same data.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon(ChunkCommon &&other) noexcept=default
Constructs a new ChunkCommon by move.
KOKKOS_DEFAULTED_FUNCTION constexpr ChunkCommon & operator=(ChunkCommon &&other) noexcept=default
Move-assigns a new value to this ChunkCommon.
KOKKOS_FUNCTION constexpr size_type extent() const noexcept
KOKKOS_FUNCTION constexpr size_type stride() const
KOKKOS_FUNCTION constexpr bool is_exhaustive() const noexcept
KOKKOS_FUNCTION constexpr mapping_type mapping() const noexcept
static KOKKOS_FUNCTION constexpr int rank() noexcept
KOKKOS_FUNCTION constexpr bool is_unique() const noexcept
KOKKOS_FUNCTION constexpr accessor_type accessor() const
KOKKOS_FUNCTION constexpr SupportType::discrete_vector_type extents() const noexcept
KOKKOS_FUNCTION constexpr size_type size() const noexcept
SupportType m_domain
The mesh on which this chunk is defined.
static KOKKOS_FUNCTION constexpr int rank_dynamic() noexcept
static KOKKOS_FUNCTION constexpr size_type static_extent(std::size_t r) noexcept
static KOKKOS_FUNCTION constexpr bool is_always_exhaustive() noexcept
auto operator[](DiscreteElement< QueryDDims... > const &slice_spec) const
Slice out some dimensions.
Definition chunk.hpp:169
auto operator[](DiscreteVector< QueryDDims... > const &slice_spec) const
Slice out some dimensions.
Definition chunk.hpp:155
char const * label() const
Returns the label of the Chunk.
Definition chunk.hpp:264
const_allocation_mdspan_type allocation_mdspan() const
Provide a mdspan on the memory allocation.
Definition chunk.hpp:288
ElementType const * data_handle() const
Access to the underlying allocation pointer.
Definition chunk.hpp:272
auto allocation_kokkos_view()
Provide an unmanaged Kokkos::View on the memory allocation.
Definition chunk.hpp:304
auto operator[](DiscreteDomain< QueryDDims... > const &odomain)
Slice out some dimensions.
Definition chunk.hpp:191
auto allocation_kokkos_view() const
Provide an unmanaged Kokkos::View on the memory allocation.
Definition chunk.hpp:320
Chunk(SupportType const &domain, Allocator allocator=Allocator())
Construct a Chunk on a domain with uninitialized values.
Definition chunk.hpp:105
Chunk & operator=(Chunk const &other)=delete
Deleted: use deepcopy instead.
allocation_mdspan_type allocation_mdspan()
Provide a mdspan on the memory allocation.
Definition chunk.hpp:296
ElementType * data_handle()
Access to the underlying allocation pointer.
Definition chunk.hpp:280
view_type span_cview() const
Definition chunk.hpp:333
Chunk(Chunk const &other)=delete
Deleted: use deepcopy instead.
~Chunk() noexcept
Definition chunk.hpp:125
Chunk(std::string const &label, SupportType const &domain, Allocator allocator=Allocator())
Construct a labeled Chunk on a domain with uninitialized values.
Definition chunk.hpp:94
element_type & operator()(DElems const &... delems) noexcept
Element access using a list of DiscreteElement.
Definition chunk.hpp:234
Chunk()=default
Empty Chunk.
Chunk & operator=(Chunk &&other) noexcept
Move-assigns a new value to this field.
Definition chunk.hpp:139
Chunk(Chunk &&other) noexcept
Constructs a new Chunk by move.
Definition chunk.hpp:116
friend class Chunk
Definition chunk.hpp:82
span_type span_view()
Definition chunk.hpp:343
view_type span_view() const
Definition chunk.hpp:338
auto operator[](DiscreteDomain< QueryDDims... > const &odomain) const
Slice out some dimensions.
Definition chunk.hpp:183
element_type const & operator()(DElems const &... delems) const noexcept
Element access using a list of DiscreteElement.
Definition chunk.hpp:202
auto operator[](DiscreteVector< QueryDDims... > const &slice_spec)
Slice out some dimensions.
Definition chunk.hpp:162
auto operator[](DiscreteElement< QueryDDims... > const &slice_spec)
Slice out some dimensions.
Definition chunk.hpp:176
static KOKKOS_FUNCTION constexpr discrete_vector_type extents() noexcept
KOKKOS_DEFAULTED_FUNCTION ~DiscreteDomain()=default
KOKKOS_FUNCTION constexpr DiscreteDomain(discrete_element_type const &element_begin, discrete_vector_type const &size)
Construct a DiscreteDomain starting from element_begin with size points.
KOKKOS_FUNCTION constexpr DiscreteDomain(DDoms const &...)
Construct a DiscreteDomain by copies and merge of domains.
KOKKOS_FUNCTION constexpr DiscreteDomain take_last(discrete_vector_type) const
KOKKOS_FUNCTION constexpr bool operator==(DiscreteDomain const &) const
KOKKOS_FUNCTION constexpr DiscreteDomain remove(discrete_vector_type, discrete_vector_type) const
static KOKKOS_FUNCTION constexpr std::size_t rank()
KOKKOS_FUNCTION constexpr DiscreteDomain remove_last(discrete_vector_type) const
KOKKOS_DEFAULTED_FUNCTION DiscreteDomain(DiscreteDomain const &x)=default
static KOKKOS_FUNCTION bool contains() noexcept
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteDomain()=default
KOKKOS_DEFAULTED_FUNCTION DiscreteDomain & operator=(DiscreteDomain &&x)=default
KOKKOS_FUNCTION constexpr operator bool()
static KOKKOS_FUNCTION constexpr std::size_t size()
static KOKKOS_FUNCTION constexpr bool empty() noexcept
static KOKKOS_FUNCTION bool contains(DiscreteElement<>) noexcept
static KOKKOS_FUNCTION constexpr discrete_element_type back() noexcept
static KOKKOS_FUNCTION DiscreteVector distance_from_front(DiscreteElement<>) noexcept
KOKKOS_FUNCTION constexpr DiscreteDomain remove_first(discrete_vector_type) const
static KOKKOS_FUNCTION constexpr discrete_element_type front() noexcept
KOKKOS_DEFAULTED_FUNCTION DiscreteDomain & operator=(DiscreteDomain const &x)=default
KOKKOS_FUNCTION constexpr DiscreteDomain take_first(discrete_vector_type) const
KOKKOS_FUNCTION constexpr DiscreteDomain restrict_with(DiscreteDomain< ODims... > const &) const
KOKKOS_FUNCTION constexpr DiscreteElement operator()(DiscreteVector<> const &) const noexcept
KOKKOS_DEFAULTED_FUNCTION DiscreteDomain(DiscreteDomain &&x)=default
static KOKKOS_FUNCTION DiscreteVector distance_from_front() noexcept
KOKKOS_DEFAULTED_FUNCTION DiscreteDomain(DiscreteDomain const &x)=default
KOKKOS_DEFAULTED_FUNCTION DiscreteDomain(DiscreteDomain &&x)=default
KOKKOS_FUNCTION constexpr DiscreteDomain remove_last(discrete_vector_type n) const
KOKKOS_FUNCTION bool contains(DElems const &... delems) const noexcept
KOKKOS_FUNCTION constexpr DiscreteDomain take_last(discrete_vector_type n) const
KOKKOS_FUNCTION constexpr DiscreteDomain(DDoms const &... domains)
Construct a DiscreteDomain by copies and merge of domains.
KOKKOS_FUNCTION constexpr decltype(auto) operator[](std::size_t n)
KOKKOS_FUNCTION constexpr DiscreteDomain remove(discrete_vector_type n1, discrete_vector_type n2) const
KOKKOS_FUNCTION constexpr decltype(auto) operator[](std::size_t n) const
KOKKOS_FUNCTION constexpr auto restrict_with(DiscreteDomain< ODDims... > const &odomain) const
static KOKKOS_FUNCTION constexpr std::size_t rank()
KOKKOS_FUNCTION constexpr bool empty() const noexcept
KOKKOS_FUNCTION constexpr std::size_t size() const
friend class DiscreteDomain
KOKKOS_FUNCTION constexpr discrete_vector_type extents() const noexcept
KOKKOS_FUNCTION constexpr DiscreteVector< QueryDDim > extent() const noexcept
KOKKOS_FUNCTION constexpr discrete_element_type front() const noexcept
KOKKOS_DEFAULTED_FUNCTION DiscreteDomain & operator=(DiscreteDomain &&x)=default
KOKKOS_FUNCTION constexpr DiscreteDomain remove_first(discrete_vector_type n) const
KOKKOS_FUNCTION constexpr bool operator==(DiscreteDomain< ODims... > const &other) const
KOKKOS_FUNCTION constexpr DiscreteDomain take_first(discrete_vector_type n) const
KOKKOS_DEFAULTED_FUNCTION ~DiscreteDomain()=default
KOKKOS_FUNCTION DiscreteVector< DDims... > distance_from_front(DElems const &... delems) const noexcept
KOKKOS_FUNCTION constexpr discrete_element_type back() const noexcept
KOKKOS_DEFAULTED_FUNCTION DiscreteDomain & operator=(DiscreteDomain const &x)=default
KOKKOS_FUNCTION constexpr DiscreteElement< DDims... > operator()(DiscreteVector< DDims... > const &dvect) const noexcept
KOKKOS_DEFAULTED_FUNCTION DiscreteDomain()=default
KOKKOS_FUNCTION constexpr operator bool()
KOKKOS_FUNCTION constexpr DiscreteDomain(discrete_element_type const &element_begin, discrete_vector_type const &size)
Construct a DiscreteDomain starting from element_begin with size points.
KOKKOS_FUNCTION constexpr DiscreteElement & operator+=(DiscreteVector< OTags... > const &rhs)
KOKKOS_FUNCTION constexpr value_type const & uid() const noexcept
KOKKOS_FUNCTION constexpr value_type & uid() noexcept
KOKKOS_DEFAULTED_FUNCTION ~DiscreteElement()=default
KOKKOS_FUNCTION constexpr DiscreteElement(DElems const &... delems) noexcept
KOKKOS_FUNCTION constexpr DiscreteElement & operator+=(IntegralType const &rhs)
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteElement(DiscreteElement const &)=default
KOKKOS_FUNCTION constexpr DiscreteElement operator--(int)
KOKKOS_FUNCTION constexpr DiscreteElement & operator-=(IntegralType const &rhs)
KOKKOS_FUNCTION constexpr DiscreteElement & operator-=(DiscreteVector< OTags... > const &rhs)
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteElement()=default
KOKKOS_FUNCTION constexpr DiscreteElement operator++(int)
KOKKOS_DEFAULTED_FUNCTION DiscreteElement & operator=(DiscreteElement const &other)=default
static KOKKOS_FUNCTION constexpr std::size_t size() noexcept
KOKKOS_FUNCTION constexpr DiscreteElement(std::array< IntegerType, sizeof...(Tags)> const &values) noexcept
KOKKOS_DEFAULTED_FUNCTION DiscreteElement & operator=(DiscreteElement &&other)=default
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteElement(DiscreteElement &&)=default
KOKKOS_FUNCTION constexpr DiscreteVectorElement const & get_or(DiscreteVectorElement const &default_value) const &
KOKKOS_FUNCTION constexpr DiscreteVector operator--(int)
KOKKOS_DEFAULTED_FUNCTION ~DiscreteVector()=default
KOKKOS_FUNCTION constexpr DiscreteVectorElement const & get() const noexcept
KOKKOS_FUNCTION constexpr DiscreteVector & operator+=(IntegralType const &rhs)
KOKKOS_FUNCTION constexpr DiscreteVector & operator-=(DiscreteVector< OTags... > const &rhs)
KOKKOS_FUNCTION constexpr DiscreteVector & operator-=(IntegralType const &rhs)
KOKKOS_FUNCTION constexpr DiscreteVector(DVects const &... delems) noexcept
KOKKOS_FUNCTION constexpr bool operator!=(DiscreteVector< OTags... > const &rhs) const noexcept
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteVector & operator=(DiscreteVector &&other)=default
static KOKKOS_FUNCTION constexpr std::size_t size() noexcept
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteVector()=default
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteVector(DiscreteVector const &)=default
KOKKOS_FUNCTION constexpr DiscreteVectorElement & get() noexcept
KOKKOS_FUNCTION constexpr bool operator==(DiscreteVector< OTags... > const &rhs) const noexcept
KOKKOS_FUNCTION constexpr DiscreteVector(std::array< IntegerType, sizeof...(Tags)> const &values) noexcept
KOKKOS_FUNCTION constexpr DiscreteVector & operator*=(DiscreteVector< OTags... > const &rhs)
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteVector(DiscreteVector &&)=default
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteVector & operator=(DiscreteVector const &other)=default
KOKKOS_FUNCTION constexpr DiscreteVector operator++(int)
KOKKOS_FUNCTION constexpr DiscreteVector & operator+=(DiscreteVector< OTags... > const &rhs)
#define DDC_BUILD_DEPRECATED_CODE
Definition config.hpp:7
The top-level namespace of DDC.
constexpr bool is_borrowed_chunk_v
constexpr bool type_seq_contains_v
Definition type_seq.hpp:259
KOKKOS_FUNCTION constexpr bool operator<(DiscreteElement< Tag > const &lhs, DiscreteElement< Tag > const &rhs)
KOKKOS_FUNCTION auto get_domain(ChunkType const &chunk) noexcept
Access the domain (or subdomain) of a view.
constexpr bool enable_chunk< Chunk< ElementType, SupportType, Allocator > >
Definition chunk.hpp:29
constexpr bool type_seq_contains_v< TypeSeq< Tags... >, OTypeSeq >
Definition type_seq.hpp:273
KOKKOS_FUNCTION constexpr DiscreteElement< Tag > operator+(DiscreteElement< Tag > const &lhs, IntegralType const &rhs)
constexpr bool type_seq_is_unique_v
Definition type_seq.hpp:262
constexpr std::size_t type_seq_size_v
Definition type_seq.hpp:246
KOKKOS_FUNCTION constexpr DiscreteElement< QueryDDims... > back(DiscreteDomain< DDims... > const &domain) noexcept
constexpr bool enable_borrowed_chunk
constexpr bool enable_chunk
KOKKOS_FUNCTION constexpr bool operator==(DiscreteElement< Tags... > const &lhs, DiscreteElement< OTags... > const &rhs) noexcept
KOKKOS_FUNCTION constexpr DiscreteVector< Tags... > operator+(DiscreteVector< Tags... > const &x)
Unary operators: +, -.
KOKKOS_FUNCTION constexpr DiscreteElement< QueryTags... > select(DiscreteElement< Tags... > &&arr) noexcept
constexpr DiscreteElement< DDim > create_reference_discrete_element() noexcept
constexpr bool is_chunk_v
KOKKOS_FUNCTION constexpr DiscreteElement< QueryTags... > select(DiscreteElement< Tags... > const &arr) noexcept
KOKKOS_FUNCTION constexpr auto const & take(HeadDElem const &head, TailDElems const &... tail)
Returns a reference towards the DiscreteElement that contains the QueryTag.
constexpr bool in_tags_v< QueryTag, TypeSeq< Tags... > >
Definition type_seq.hpp:269
KOKKOS_FUNCTION constexpr DiscreteVector< Tag > operator-(IntegralType const &lhs, DiscreteVector< Tag > const &rhs)
KOKKOS_FUNCTION constexpr auto remove_dims_of(DiscreteDomain< DDimsA... > const &DDom_a, DiscreteDomain< DDimsB... > const &) noexcept
KOKKOS_FUNCTION constexpr bool operator<(DiscreteVector< Tag > const &lhs, IntegralType const &rhs)
KOKKOS_FUNCTION constexpr DiscreteVectorElement const & get_or(DiscreteVector< Tags... > const &tuple, DiscreteVectorElement const &default_value) noexcept
KOKKOS_FUNCTION constexpr auto operator-(DiscreteVector< Tags... > const &lhs, DiscreteVector< OTags... > const &rhs)
KOKKOS_FUNCTION constexpr auto remove_dims_of(DiscreteDomain< DDimsA... > const &DDom_a) noexcept
Remove the dimensions DDimsB from DDom_a.
constexpr bool type_seq_is_unique_v< TypeSeq< Tags... > >
Definition type_seq.hpp:296
KOKKOS_FUNCTION constexpr DiscreteVector< Tags... > operator-(DiscreteElement< Tags... > const &lhs, DiscreteElement< OTags... > const &rhs)
binary operator: -
KOKKOS_FUNCTION constexpr DiscreteElement< QueryDDims... > front(DiscreteDomain< DDims... > const &domain) noexcept
KOKKOS_FUNCTION constexpr DiscreteVectorElement & get(DiscreteVector< Tags... > &tuple) noexcept
KOKKOS_FUNCTION constexpr DiscreteElement< QueryTag > select_or(DiscreteElement< Tags... > const &arr, DiscreteElement< QueryTag > const &default_value) noexcept
constexpr bool is_writable_chunk_v
KOKKOS_FUNCTION constexpr DiscreteVector< Tag > operator+(IntegralType const &lhs, DiscreteVector< Tag > const &rhs)
constexpr bool is_discrete_vector_v
KOKKOS_FUNCTION constexpr DiscreteElementType const & uid(DiscreteElement< Tag > const &tuple) noexcept
KOKKOS_FUNCTION constexpr DiscreteElement< Tags... > operator+(DiscreteElement< Tags... > const &lhs, DiscreteVector< OTags... > const &rhs)
right external binary operators: +, -
KOKKOS_FUNCTION constexpr DiscreteVectorElement const & get(DiscreteVector< Tags... > const &tuple) noexcept
KOKKOS_FUNCTION constexpr DiscreteVector< Tags... > operator-(DiscreteVector< Tags... > const &x)
constexpr bool is_discrete_element_v
KOKKOS_FUNCTION constexpr DiscreteVector< QueryTags... > select(DiscreteVector< Tags... > const &arr) noexcept
KOKKOS_FUNCTION constexpr DiscreteVector< QueryDDims... > extents(DiscreteDomain< DDims... > const &domain) noexcept
Chunk(SupportType const &, Allocator) -> Chunk< typename Allocator::value_type, SupportType, Allocator >
KOKKOS_FUNCTION constexpr bool operator>=(DiscreteElement< Tag > const &lhs, DiscreteElement< Tag > const &rhs)
KOKKOS_FUNCTION constexpr auto operator+(DiscreteVector< Tags... > const &lhs, DiscreteVector< OTags... > const &rhs)
Internal binary operators: +, -.
KOKKOS_FUNCTION constexpr auto replace_dim_of(DiscreteDomain< DDimsA... > const &DDom_a, DiscreteDomain< DDimsB... > const &DDom_b) noexcept
KOKKOS_FUNCTION constexpr bool operator<=(DiscreteElement< Tag > const &lhs, DiscreteElement< Tag > const &rhs)
KOKKOS_FUNCTION constexpr bool operator<(DiscreteVector< Tag > const &lhs, DiscreteVector< Tag > const &rhs)
KOKKOS_FUNCTION constexpr DiscreteElementType & uid(DiscreteElement< Tags... > &tuple) noexcept
constexpr bool in_tags_v
Definition type_seq.hpp:256
Chunk(std::string const &, SupportType const &, Allocator) -> Chunk< typename Allocator::value_type, SupportType, Allocator >
KOKKOS_FUNCTION constexpr DiscreteVector< QueryTag > select_or(DiscreteVector< Tags... > const &arr, DiscreteVector< QueryTag > const &default_value) noexcept
KOKKOS_FUNCTION constexpr bool operator>(DiscreteElement< Tag > const &lhs, DiscreteElement< Tag > const &rhs)
KOKKOS_FUNCTION constexpr DiscreteElementType & uid(DiscreteElement< Tag > &tuple) noexcept
constexpr bool is_discrete_domain_v
KOKKOS_FUNCTION constexpr DiscreteVector< QueryTags... > select(DiscreteVector< Tags... > &&arr) noexcept
KOKKOS_FUNCTION constexpr DiscreteElement< Tag > operator-(DiscreteElement< Tag > const &lhs, IntegralType const &rhs)
KOKKOS_FUNCTION constexpr DiscreteElement< Tags... > operator-(DiscreteElement< Tags... > const &lhs, DiscreteVector< OTags... > const &rhs)
KOKKOS_FUNCTION constexpr DiscreteElementType const & uid(DiscreteElement< Tags... > const &tuple) noexcept
KOKKOS_FUNCTION constexpr auto operator*(IntegralType const &lhs, DiscreteVector< Tags... > const &rhs)
external left binary operator: *
KOKKOS_FUNCTION constexpr DiscreteDomain< QueryDDims... > select(DiscreteDomain< DDims... > const &domain)
KOKKOS_FUNCTION constexpr DiscreteVector< Tag > operator-(DiscreteVector< Tag > const &lhs, IntegralType const &rhs)
constexpr bool type_seq_same_v
Definition type_seq.hpp:265
constexpr std::size_t type_seq_rank_v
Definition type_seq.hpp:253
KOKKOS_FUNCTION constexpr DiscreteVector< Tag > operator+(DiscreteVector< Tag > const &lhs, IntegralType const &rhs)
A compile-time sequence of types.
Definition type_seq.hpp:30
KOKKOS_FUNCTION constexpr DiscreteDomainIterator operator--(int)
friend KOKKOS_FUNCTION constexpr bool operator<=(DiscreteDomainIterator const &xx, DiscreteDomainIterator const &yy)
KOKKOS_FUNCTION constexpr DiscreteElement< DDim > operator*() const noexcept
friend KOKKOS_FUNCTION constexpr bool operator>=(DiscreteDomainIterator const &xx, DiscreteDomainIterator const &yy)
KOKKOS_DEFAULTED_FUNCTION DiscreteDomainIterator()=default
KOKKOS_FUNCTION constexpr DiscreteElement< DDim > operator[](difference_type n) const
KOKKOS_FUNCTION constexpr DiscreteDomainIterator & operator--()
KOKKOS_FUNCTION constexpr DiscreteDomainIterator operator++(int)
friend KOKKOS_FUNCTION constexpr DiscreteDomainIterator operator-(DiscreteDomainIterator i, difference_type n)
friend KOKKOS_FUNCTION constexpr DiscreteDomainIterator operator+(DiscreteDomainIterator i, difference_type n)
friend KOKKOS_FUNCTION constexpr bool operator>(DiscreteDomainIterator const &xx, DiscreteDomainIterator const &yy)
friend KOKKOS_FUNCTION constexpr bool operator!=(DiscreteDomainIterator const &xx, DiscreteDomainIterator const &yy)
friend KOKKOS_FUNCTION constexpr bool operator<(DiscreteDomainIterator const &xx, DiscreteDomainIterator const &yy)
KOKKOS_FUNCTION constexpr DiscreteDomainIterator & operator+=(difference_type n)
KOKKOS_FUNCTION constexpr DiscreteDomainIterator & operator++()
friend KOKKOS_FUNCTION constexpr DiscreteDomainIterator operator+(difference_type n, DiscreteDomainIterator i)
friend KOKKOS_FUNCTION constexpr bool operator==(DiscreteDomainIterator const &xx, DiscreteDomainIterator const &yy)
KOKKOS_FUNCTION constexpr DiscreteDomainIterator(DiscreteElement< DDim > value)
KOKKOS_FUNCTION constexpr DiscreteDomainIterator & operator-=(difference_type n)
friend KOKKOS_FUNCTION constexpr difference_type operator-(DiscreteDomainIterator const &xx, DiscreteDomainIterator const &yy)