DDC 0.5.0
Loading...
Searching...
No Matches
storage_discrete_domain.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 <cassert>
8#include <cstddef>
9#include <iterator>
10#include <tuple>
11#include <type_traits>
12
13#include <Kokkos_Core.hpp>
14#include <Kokkos_StdAlgorithms.hpp>
15
16#include "ddc/detail/kokkos.hpp"
17#include "ddc/detail/tagged_vector.hpp"
18#include "ddc/detail/type_seq.hpp"
19#include "ddc/discrete_element.hpp"
20#include "ddc/discrete_vector.hpp"
21
22namespace ddc {
23
24template <class DDim>
25struct StorageDiscreteDomainIterator;
26
27template <class... DDims>
29
30template <class T>
31struct is_storage_discrete_domain : std::false_type
32{
33};
34
35template <class... Tags>
36struct is_storage_discrete_domain<StorageDiscreteDomain<Tags...>> : std::true_type
37{
38};
39
40template <class T>
42
43
44namespace detail {
45
46template <class... Tags>
47struct ToTypeSeq<StorageDiscreteDomain<Tags...>>
48{
49 using type = TypeSeq<Tags...>;
50};
51
52template <class T, class U>
53struct RebindDomain;
54
55template <class... DDims, class... ODDims>
56struct RebindDomain<StorageDiscreteDomain<DDims...>, detail::TypeSeq<ODDims...>>
57{
58 using type = StorageDiscreteDomain<ODDims...>;
59};
60
61template <class InputIt1, class InputIt2>
62KOKKOS_FUNCTION bool equal(InputIt1 first1, InputIt1 last1, InputIt2 first2)
63{
64 for (; first1 != last1; ++first1, ++first2) {
65 if (!(*first1 == *first2)) {
66 return false;
67 }
68 }
69
70 return true;
71}
72
73template <
74 class ForwardIt,
75 class T = typename std::iterator_traits<ForwardIt>::value_type,
76 class Compare>
77KOKKOS_FUNCTION ForwardIt lower_bound(ForwardIt first, ForwardIt last, const T& value, Compare comp)
78{
79 ForwardIt it;
80 typename std::iterator_traits<ForwardIt>::difference_type count = last - first;
81 while (count > 0) {
82 it = first;
83 typename std::iterator_traits<ForwardIt>::difference_type const step = count / 2;
84 it += step;
85
86 if (comp(*it, value)) {
87 first = ++it;
88 count -= step + 1;
89 } else {
90 count = step;
91 }
92 }
93
94 return first;
95}
96
97template <
98 class ForwardIt,
99 class T = typename std::iterator_traits<ForwardIt>::value_type,
100 class Compare>
101KOKKOS_FUNCTION bool binary_search(ForwardIt first, ForwardIt last, const T& value, Compare comp)
102{
103 first = ::ddc::detail::lower_bound(first, last, value, comp);
104 return (!(first == last) && !(comp(value, *first)));
105}
106
107template <class DDim>
108struct GetUidFn
109{
110 KOKKOS_FUNCTION DiscreteElementType
111 operator()(DiscreteElement<DDim> const& delem) const noexcept
112 {
113 return delem.uid();
114 }
115};
116
117} // namespace detail
118
119template <class... DDims>
121{
122 template <class...>
123 friend class StorageDiscreteDomain;
124
125public:
126 using discrete_element_type = DiscreteElement<DDims...>;
127
128 using discrete_vector_type = DiscreteVector<DDims...>;
129
130private:
131 detail::TaggedVector<Kokkos::View<DiscreteElementType*, Kokkos::SharedSpace>, DDims...> m_views;
132
133public:
134 static KOKKOS_FUNCTION constexpr std::size_t rank()
135 {
136 return sizeof...(DDims);
137 }
138
140
141 /// Construct a StorageDiscreteDomain by copies and merge of domains
142 template <
143 class... DDoms,
144 class = std::enable_if_t<(is_storage_discrete_domain_v<DDoms> && ...)>>
145 KOKKOS_FUNCTION constexpr explicit StorageDiscreteDomain(DDoms const&... domains)
146 : m_views(domains.m_views...)
147 {
148 }
149
150 /** Construct a StorageDiscreteDomain with Kokkos::View explicitly listing the discrete elements.
151 * @param views list of Kokkos::View
152 */
153 explicit StorageDiscreteDomain(
154 Kokkos::View<DiscreteElement<DDims>*, Kokkos::SharedSpace> const&... views)
155 {
156 ((m_views[type_seq_rank_v<DDims, detail::TypeSeq<DDims...>>]
157 = Kokkos::View<DiscreteElementType*, Kokkos::SharedSpace>(views.label(), views.size())),
158 ...);
159 Kokkos::DefaultExecutionSpace const execution_space;
160 ((Kokkos::Experimental::transform(
161 "StorageDiscreteDomainCtor",
162 execution_space,
163 views,
164 m_views[type_seq_rank_v<DDims, detail::TypeSeq<DDims...>>],
165 detail::GetUidFn<DDims>())),
166 ...);
167 execution_space.fence("StorageDiscreteDomainCtor");
168 }
169
171
173
175
177 = default;
178
180
181 template <class... ODims>
182 KOKKOS_FUNCTION constexpr bool operator==(StorageDiscreteDomain<ODims...> const& other) const
183 {
184 if (empty() && other.empty()) {
185 return true;
186 }
187 if (m_views.size() != other.m_views.size()) {
188 return false;
189 }
190 for (std::size_t i = 0; i < m_views.size(); ++i) {
191 if (m_views[i].size() != other.m_views[i].size()) {
192 return false;
193 }
194 if (!detail::
195 equal(m_views[i].data(),
196 m_views[i].data() + m_views[i].size(),
197 other.m_views[i].data())) {
198 return false;
199 }
200 }
201 return true;
202 }
203
204#if !defined(__cpp_impl_three_way_comparison) || __cpp_impl_three_way_comparison < 201902L
205 // In C++20, `a!=b` shall be automatically translated by the compiler to `!(a==b)`
206 template <class... ODims>
207 KOKKOS_FUNCTION constexpr bool operator!=(StorageDiscreteDomain<ODims...> const& other) const
208 {
209 return !(*this == other);
210 }
211#endif
212
213 KOKKOS_FUNCTION constexpr std::size_t size() const
214 {
215 return (1UL * ... * get<DDims>(m_views).size());
216 }
217
218 KOKKOS_FUNCTION constexpr discrete_vector_type extents() const noexcept
219 {
220 return discrete_vector_type(get<DDims>(m_views).size()...);
221 }
222
223 KOKKOS_FUNCTION constexpr auto discrete_elements() const noexcept
224 {
225 return m_views;
226 }
227
228 template <class QueryDDim>
229 KOKKOS_FUNCTION constexpr DiscreteVector<QueryDDim> extent() const noexcept
230 {
231 return DiscreteVector<QueryDDim>(get<QueryDDim>(m_views).size());
232 }
233
234 KOKKOS_FUNCTION constexpr discrete_element_type front() const noexcept
235 {
236 return discrete_element_type(get<DDims>(m_views)(0)...);
237 }
238
239 KOKKOS_FUNCTION constexpr discrete_element_type back() const noexcept
240 {
241 return discrete_element_type(get<DDims>(m_views)(get<DDims>(m_views).size() - 1)...);
242 }
243
244 KOKKOS_FUNCTION constexpr StorageDiscreteDomain take_first(discrete_vector_type n) const
245 {
247 }
248
249 KOKKOS_FUNCTION constexpr StorageDiscreteDomain take_last(discrete_vector_type n) const
250 {
251 return StorageDiscreteDomain(front() + prod(extents() - n), n);
252 }
253
254 KOKKOS_FUNCTION constexpr StorageDiscreteDomain remove_first(discrete_vector_type n) const
255 {
256 return StorageDiscreteDomain(front() + prod(n), extents() - n);
257 }
258
259 KOKKOS_FUNCTION constexpr StorageDiscreteDomain remove_last(discrete_vector_type n) const
260 {
262 }
263
265 discrete_vector_type n1,
266 discrete_vector_type n2) const
267 {
268 return StorageDiscreteDomain(front() + prod(n1), extents() - n1 - n2);
269 }
270
271 KOKKOS_FUNCTION constexpr DiscreteElement<DDims...> operator()(
272 DiscreteVector<DDims...> const& dvect) const noexcept
273 {
274 return m_views(get<DDims>(dvect)...);
275 }
276
277 template <class... DElems>
278 KOKKOS_FUNCTION bool contains(DElems const&... delems) const noexcept
279 {
280 static_assert(
281 sizeof...(DDims) == (0 + ... + DElems::size()),
282 "Invalid number of dimensions");
283 static_assert((is_discrete_element_v<DElems> && ...), "Expected DiscreteElements");
284 return (detail::binary_search(
285 get<DDims>(m_views).data(),
286 get<DDims>(m_views).data() + get<DDims>(m_views).size(),
287 uid<DDims>(take<DDims>(delems...)),
288 std::less {})
289 && ...);
290 }
291
292 template <class... DElems>
294 DElems const&... delems) const noexcept
295 {
296 static_assert(
297 sizeof...(DDims) == (0 + ... + DElems::size()),
298 "Invalid number of dimensions");
299 static_assert((is_discrete_element_v<DElems> && ...), "Expected DiscreteElements");
300 assert(contains(delems...));
301 return DiscreteVector<DDims...>(
302 (detail::lower_bound(
303 get<DDims>(m_views).data(),
304 get<DDims>(m_views).data() + get<DDims>(m_views).size(),
305 uid<DDims>(take<DDims>(delems...)),
306 std::less {})
307 - get<DDims>(m_views).data())...);
308 }
309
310 KOKKOS_FUNCTION constexpr bool empty() const noexcept
311 {
312 return size() == 0;
313 }
314
315 KOKKOS_FUNCTION constexpr explicit operator bool()
316 {
317 return !empty();
318 }
319
320 template <
321 std::size_t N = sizeof...(DDims),
322 class DDim0 = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
323 KOKKOS_FUNCTION auto begin() const
324 {
325 return Kokkos::Experimental::begin(get<DDim0>(m_views));
326 }
327
328 template <
329 std::size_t N = sizeof...(DDims),
330 class DDim0 = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
331 KOKKOS_FUNCTION auto end() const
332 {
333 return Kokkos::Experimental::end(get<DDim0>(m_views));
334 }
335
336 template <
337 std::size_t N = sizeof...(DDims),
338 class DDim0 = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
339 KOKKOS_FUNCTION auto cbegin() const
340 {
341 return Kokkos::Experimental::cbegin(get<DDim0>(m_views));
342 }
343
344 template <
345 std::size_t N = sizeof...(DDims),
346 class DDim0 = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
347 KOKKOS_FUNCTION auto cend() const
348 {
349 return Kokkos::Experimental::cend(get<DDim0>(m_views));
350 }
351
352 template <
353 std::size_t N = sizeof...(DDims),
354 class = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
355 KOKKOS_FUNCTION constexpr decltype(auto) operator[](std::size_t n)
356 {
357 return begin()[n];
358 }
359
360 template <
361 std::size_t N = sizeof...(DDims),
362 class = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
363 KOKKOS_FUNCTION constexpr decltype(auto) operator[](std::size_t n) const
364 {
365 return begin()[n];
366 }
367};
368
369template <>
371{
372 template <class...>
373 friend class StorageDiscreteDomain;
374
375public:
376 using discrete_element_type = DiscreteElement<>;
377
378 using discrete_vector_type = DiscreteVector<>;
379
380 static KOKKOS_FUNCTION constexpr std::size_t rank()
381 {
382 return 0;
383 }
384
386
387 // Construct a StorageDiscreteDomain from a reordered copy of `domain`
388 template <class... ODDims>
389 KOKKOS_FUNCTION constexpr explicit StorageDiscreteDomain(
390 [[maybe_unused]] StorageDiscreteDomain<ODDims...> const& domain)
391 {
392 }
393
395
397
399
401 = default;
402
404
405 KOKKOS_FUNCTION constexpr bool operator==(
406 [[maybe_unused]] StorageDiscreteDomain const& other) const
407 {
408 return true;
409 }
410
411#if !defined(__cpp_impl_three_way_comparison) || __cpp_impl_three_way_comparison < 201902L
412 // In C++20, `a!=b` shall be automatically translated by the compiler to `!(a==b)`
413 KOKKOS_FUNCTION constexpr bool operator!=(StorageDiscreteDomain const& other) const
414 {
415 return !(*this == other);
416 }
417#endif
418
419 static KOKKOS_FUNCTION constexpr std::size_t size()
420 {
421 return 1;
422 }
423
424 static KOKKOS_FUNCTION constexpr discrete_vector_type extents() noexcept
425 {
426 return {};
427 }
428
429 static KOKKOS_FUNCTION constexpr discrete_element_type front() noexcept
430 {
431 return {};
432 }
433
434 static KOKKOS_FUNCTION constexpr discrete_element_type back() noexcept
435 {
436 return {};
437 }
438
440 [[maybe_unused]] discrete_vector_type n) const
441 {
442 return *this;
443 }
444
446 [[maybe_unused]] discrete_vector_type n) const
447 {
448 return *this;
449 }
450
452 [[maybe_unused]] discrete_vector_type n) const
453 {
454 return *this;
455 }
456
458 [[maybe_unused]] discrete_vector_type n) const
459 {
460 return *this;
461 }
462
464 [[maybe_unused]] discrete_vector_type n1,
465 [[maybe_unused]] discrete_vector_type n2) const
466 {
467 return *this;
468 }
469
470 KOKKOS_FUNCTION constexpr DiscreteElement<> operator()(
471 DiscreteVector<> const& /* dvect */) const noexcept
472 {
473 return {};
474 }
475
476 static KOKKOS_FUNCTION bool contains() noexcept
477 {
478 return true;
479 }
480
481 static KOKKOS_FUNCTION bool contains(DiscreteElement<>) noexcept
482 {
483 return true;
484 }
485
487 {
488 return {};
489 }
490
491 static KOKKOS_FUNCTION DiscreteVector<> distance_from_front(DiscreteElement<>) noexcept
492 {
493 return {};
494 }
495
496 static KOKKOS_FUNCTION constexpr bool empty() noexcept
497 {
498 return false;
499 }
500
501 KOKKOS_FUNCTION constexpr explicit operator bool()
502 {
503 return true;
504 }
505};
506
507template <class... QueryDDims, class... DDims>
508KOKKOS_FUNCTION constexpr StorageDiscreteDomain<QueryDDims...> select(
509 StorageDiscreteDomain<DDims...> const& domain)
510{
511 return StorageDiscreteDomain<QueryDDims...>(
512 DiscreteElement<QueryDDims...>(domain.front()),
513 DiscreteElement<QueryDDims...>(domain.extents()));
514}
515
516namespace detail {
517
518template <class T>
519struct ConvertTypeSeqToStorageDiscreteDomain;
520
521template <class... DDims>
522struct ConvertTypeSeqToStorageDiscreteDomain<detail::TypeSeq<DDims...>>
523{
524 using type = StorageDiscreteDomain<DDims...>;
525};
526
527template <class T>
528using convert_type_seq_to_storage_discrete_domain_t =
529 typename ConvertTypeSeqToStorageDiscreteDomain<T>::type;
530
531} // namespace detail
532
533// Computes the subtraction DDom_a - DDom_b in the sense of linear spaces(retained dimensions are those in DDom_a which are not in DDom_b)
534template <class... DDimsA, class... DDimsB>
535KOKKOS_FUNCTION constexpr auto remove_dims_of(
536 StorageDiscreteDomain<DDimsA...> const& DDom_a,
537 [[maybe_unused]] StorageDiscreteDomain<DDimsB...> const& DDom_b) noexcept
538{
539 using TagSeqA = detail::TypeSeq<DDimsA...>;
540 using TagSeqB = detail::TypeSeq<DDimsB...>;
541
542 using type_seq_r = type_seq_remove_t<TagSeqA, TagSeqB>;
543 return detail::convert_type_seq_to_storage_discrete_domain_t<type_seq_r>(DDom_a);
544}
545
546//! Remove the dimensions DDimsB from DDom_a
547//! @param[in] DDom_a The discrete domain on which to remove dimensions
548//! @return The discrete domain without DDimsB dimensions
549template <class... DDimsB, class... DDimsA>
550KOKKOS_FUNCTION constexpr auto remove_dims_of(
551 StorageDiscreteDomain<DDimsA...> const& DDom_a) noexcept
552{
553 using TagSeqA = detail::TypeSeq<DDimsA...>;
554 using TagSeqB = detail::TypeSeq<DDimsB...>;
555
556 using type_seq_r = type_seq_remove_t<TagSeqA, TagSeqB>;
557 return detail::convert_type_seq_to_storage_discrete_domain_t<type_seq_r>(DDom_a);
558}
559
560namespace detail {
561
562// Checks if dimension of DDom_a is DDim1. If not, returns restriction to DDim2 of DDom_b. May not be useful in its own, it helps for replace_dim_of
563template <typename DDim1, typename DDim2, typename DDimA, typename... DDimsB>
564KOKKOS_FUNCTION constexpr std::conditional_t<
565 std::is_same_v<DDimA, DDim1>,
568replace_dim_of_1d(
569 StorageDiscreteDomain<DDimA> const& DDom_a,
570 [[maybe_unused]] StorageDiscreteDomain<DDimsB...> const& DDom_b) noexcept
571{
572 if constexpr (std::is_same_v<DDimA, DDim1>) {
573 return ddc::StorageDiscreteDomain<DDim2>(DDom_b);
574 } else {
575 return DDom_a;
576 }
577}
578
579} // namespace detail
580
581// Replace in DDom_a the dimension Dim1 by the dimension Dim2 of DDom_b
582template <typename DDim1, typename DDim2, typename... DDimsA, typename... DDimsB>
583KOKKOS_FUNCTION constexpr auto replace_dim_of(
584 StorageDiscreteDomain<DDimsA...> const& DDom_a,
585 [[maybe_unused]] StorageDiscreteDomain<DDimsB...> const& DDom_b) noexcept
586{
587 // TODO : static_asserts
588 using TagSeqA = detail::TypeSeq<DDimsA...>;
589 using TagSeqB = detail::TypeSeq<DDim1>;
590 using TagSeqC = detail::TypeSeq<DDim2>;
591
592 using type_seq_r = ddc::type_seq_replace_t<TagSeqA, TagSeqB, TagSeqC>;
593 return ddc::detail::convert_type_seq_to_storage_discrete_domain_t<type_seq_r>(
594 detail::replace_dim_of_1d<
595 DDim1,
596 DDim2,
597 DDimsA,
598 DDimsB...>(ddc::StorageDiscreteDomain<DDimsA>(DDom_a), DDom_b)...);
599}
600
601template <class... QueryDDims, class... DDims>
602KOKKOS_FUNCTION constexpr DiscreteVector<QueryDDims...> extents(
603 StorageDiscreteDomain<DDims...> const& domain) noexcept
604{
605 return DiscreteVector<QueryDDims...>(StorageDiscreteDomain<QueryDDims>(domain).size()...);
606}
607
608template <class... QueryDDims, class... DDims>
609KOKKOS_FUNCTION constexpr DiscreteElement<QueryDDims...> front(
610 StorageDiscreteDomain<DDims...> const& domain) noexcept
611{
612 return DiscreteElement<QueryDDims...>(StorageDiscreteDomain<QueryDDims>(domain).front()...);
613}
614
615template <class... QueryDDims, class... DDims>
616KOKKOS_FUNCTION constexpr DiscreteElement<QueryDDims...> back(
617 StorageDiscreteDomain<DDims...> const& domain) noexcept
618{
619 return DiscreteElement<QueryDDims...>(StorageDiscreteDomain<QueryDDims>(domain).back()...);
620}
621
622} // namespace ddc
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteElement()=default
KOKKOS_FUNCTION constexpr bool operator!=(DiscreteVector< OTags... > const &rhs) const noexcept
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteVector()=default
static KOKKOS_FUNCTION constexpr discrete_element_type back() noexcept
KOKKOS_DEFAULTED_FUNCTION StorageDiscreteDomain & operator=(StorageDiscreteDomain const &x)=default
static KOKKOS_FUNCTION constexpr bool empty() noexcept
static KOKKOS_FUNCTION DiscreteVector distance_from_front(DiscreteElement<>) noexcept
KOKKOS_FUNCTION constexpr StorageDiscreteDomain remove(discrete_vector_type n1, discrete_vector_type n2) const
static KOKKOS_FUNCTION bool contains() noexcept
KOKKOS_FUNCTION constexpr StorageDiscreteDomain take_last(discrete_vector_type n) const
KOKKOS_FUNCTION constexpr StorageDiscreteDomain take_first(discrete_vector_type n) const
static KOKKOS_FUNCTION constexpr discrete_element_type front() noexcept
KOKKOS_FUNCTION constexpr DiscreteElement operator()(DiscreteVector<> const &) const noexcept
KOKKOS_FUNCTION constexpr operator bool()
KOKKOS_DEFAULTED_FUNCTION ~StorageDiscreteDomain()=default
KOKKOS_DEFAULTED_FUNCTION StorageDiscreteDomain & operator=(StorageDiscreteDomain &&x)=default
KOKKOS_FUNCTION constexpr bool operator==(StorageDiscreteDomain const &other) const
KOKKOS_DEFAULTED_FUNCTION StorageDiscreteDomain(StorageDiscreteDomain const &x)=default
static KOKKOS_FUNCTION constexpr discrete_vector_type extents() noexcept
static KOKKOS_FUNCTION bool contains(DiscreteElement<>) noexcept
static KOKKOS_FUNCTION constexpr std::size_t rank()
KOKKOS_DEFAULTED_FUNCTION constexpr StorageDiscreteDomain()=default
KOKKOS_FUNCTION constexpr StorageDiscreteDomain remove_first(discrete_vector_type n) const
static KOKKOS_FUNCTION DiscreteVector distance_from_front() noexcept
static KOKKOS_FUNCTION constexpr std::size_t size()
KOKKOS_FUNCTION constexpr StorageDiscreteDomain(StorageDiscreteDomain< ODDims... > const &domain)
KOKKOS_FUNCTION constexpr StorageDiscreteDomain remove_last(discrete_vector_type n) const
KOKKOS_DEFAULTED_FUNCTION StorageDiscreteDomain(StorageDiscreteDomain &&x)=default
KOKKOS_FUNCTION constexpr std::size_t size() const
KOKKOS_FUNCTION auto begin() const
KOKKOS_FUNCTION constexpr StorageDiscreteDomain(DDoms const &... domains)
Construct a StorageDiscreteDomain by copies and merge of domains.
KOKKOS_FUNCTION auto cend() const
KOKKOS_FUNCTION constexpr discrete_element_type front() const noexcept
KOKKOS_FUNCTION auto cbegin() const
KOKKOS_FUNCTION bool contains(DElems const &... delems) const noexcept
KOKKOS_DEFAULTED_FUNCTION StorageDiscreteDomain(StorageDiscreteDomain const &x)=default
KOKKOS_FUNCTION DiscreteVector< DDims... > distance_from_front(DElems const &... delems) const noexcept
KOKKOS_FUNCTION constexpr StorageDiscreteDomain take_last(discrete_vector_type n) const
KOKKOS_FUNCTION constexpr StorageDiscreteDomain take_first(discrete_vector_type n) const
KOKKOS_FUNCTION constexpr discrete_element_type back() const noexcept
KOKKOS_FUNCTION constexpr StorageDiscreteDomain remove_first(discrete_vector_type n) const
KOKKOS_FUNCTION constexpr bool empty() const noexcept
KOKKOS_FUNCTION auto end() const
KOKKOS_DEFAULTED_FUNCTION StorageDiscreteDomain & operator=(StorageDiscreteDomain &&x)=default
static KOKKOS_FUNCTION constexpr std::size_t rank()
KOKKOS_DEFAULTED_FUNCTION ~StorageDiscreteDomain()=default
KOKKOS_FUNCTION constexpr operator bool()
KOKKOS_FUNCTION constexpr DiscreteElement< DDims... > operator()(DiscreteVector< DDims... > const &dvect) const noexcept
KOKKOS_FUNCTION constexpr bool operator==(StorageDiscreteDomain< ODims... > const &other) const
KOKKOS_FUNCTION constexpr DiscreteVector< QueryDDim > extent() const noexcept
KOKKOS_FUNCTION constexpr StorageDiscreteDomain remove_last(discrete_vector_type n) const
KOKKOS_FUNCTION constexpr discrete_vector_type extents() const noexcept
KOKKOS_FUNCTION constexpr decltype(auto) operator[](std::size_t n) const
KOKKOS_DEFAULTED_FUNCTION StorageDiscreteDomain(StorageDiscreteDomain &&x)=default
KOKKOS_FUNCTION constexpr auto discrete_elements() const noexcept
KOKKOS_FUNCTION constexpr decltype(auto) operator[](std::size_t n)
KOKKOS_DEFAULTED_FUNCTION StorageDiscreteDomain & operator=(StorageDiscreteDomain const &x)=default
KOKKOS_FUNCTION constexpr StorageDiscreteDomain remove(discrete_vector_type n1, discrete_vector_type n2) const
StorageDiscreteDomain(Kokkos::View< DiscreteElement< DDims > *, Kokkos::SharedSpace > const &... views)
Construct a StorageDiscreteDomain with Kokkos::View explicitly listing the discrete elements.
KOKKOS_DEFAULTED_FUNCTION StorageDiscreteDomain()=default
The top-level namespace of DDC.
KOKKOS_FUNCTION constexpr auto remove_dims_of(StorageDiscreteDomain< DDimsA... > const &DDom_a) noexcept
Remove the dimensions DDimsB from DDom_a.
KOKKOS_FUNCTION constexpr DiscreteElement< QueryDDims... > front(StorageDiscreteDomain< DDims... > const &domain) noexcept
constexpr bool is_storage_discrete_domain_v
KOKKOS_FUNCTION constexpr DiscreteElement< QueryDDims... > back(StorageDiscreteDomain< DDims... > const &domain) noexcept
KOKKOS_FUNCTION constexpr DiscreteVector< QueryDDims... > extents(StorageDiscreteDomain< DDims... > const &domain) noexcept
KOKKOS_FUNCTION constexpr auto replace_dim_of(StorageDiscreteDomain< DDimsA... > const &DDom_a, StorageDiscreteDomain< DDimsB... > const &DDom_b) noexcept
KOKKOS_FUNCTION constexpr auto remove_dims_of(StorageDiscreteDomain< DDimsA... > const &DDom_a, StorageDiscreteDomain< DDimsB... > const &DDom_b) noexcept
KOKKOS_FUNCTION constexpr StorageDiscreteDomain< QueryDDims... > select(StorageDiscreteDomain< DDims... > const &domain)