DDC 0.4.1
Loading...
Searching...
No Matches
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_Macros.hpp>
14
15#include "ddc/detail/type_seq.hpp"
16#include "ddc/discrete_element.hpp"
17#include "ddc/discrete_vector.hpp"
18
19namespace ddc {
20
21template <class DDim>
23
24template <class... DDims>
25class DiscreteDomain;
26
27template <class T>
28struct is_discrete_domain : std::false_type
29{
30};
31
32template <class... Tags>
33struct is_discrete_domain<DiscreteDomain<Tags...>> : std::true_type
34{
35};
36
37template <class T>
38inline constexpr bool is_discrete_domain_v = is_discrete_domain<T>::value;
39
40
41namespace detail {
42
43template <class... Tags>
44struct ToTypeSeq<DiscreteDomain<Tags...>>
45{
46 using type = TypeSeq<Tags...>;
47};
48
49} // namespace detail
50
51template <class... DDims>
53{
54 template <class...>
55 friend class DiscreteDomain;
56
57public:
58 using discrete_element_type = DiscreteElement<DDims...>;
59
60 using discrete_vector_type = DiscreteVector<DDims...>;
61
62private:
63 DiscreteElement<DDims...> m_element_begin;
64
65 DiscreteElement<DDims...> m_element_end;
66
67public:
68 static KOKKOS_FUNCTION constexpr std::size_t rank()
69 {
70 return sizeof...(DDims);
71 }
72
74
75 /// Construct a DiscreteDomain by copies and merge of domains
76 template <class... DDoms, class = std::enable_if_t<(is_discrete_domain_v<DDoms> && ...)>>
77 KOKKOS_FUNCTION constexpr explicit DiscreteDomain(DDoms const&... domains)
78 : m_element_begin(domains.front()...)
79 , m_element_end((domains.front() + domains.extents())...)
80 {
81 }
82
83 /** Construct a DiscreteDomain starting from element_begin with size points.
84 * @param element_begin the lower bound in each direction
85 * @param size the number of points in each direction
86 */
88 discrete_element_type const& element_begin,
89 discrete_vector_type const& size)
90 : m_element_begin(element_begin)
91 , m_element_end(element_begin + size)
92 {
93 }
94
96
98
100
102
104
105 template <class... ODims>
106 KOKKOS_FUNCTION constexpr bool operator==(DiscreteDomain<ODims...> const& other) const
107 {
108 if (empty() && other.empty()) {
109 return true;
110 }
111 return m_element_begin == other.m_element_begin && m_element_end == other.m_element_end;
112 }
113
114#if !defined(__cpp_impl_three_way_comparison) || __cpp_impl_three_way_comparison < 201902L
115 // In C++20, `a!=b` shall be automatically translated by the compiler to `!(a==b)`
116 template <class... ODims>
117 KOKKOS_FUNCTION constexpr bool operator!=(DiscreteDomain<ODims...> const& other) const
118 {
119 return !(*this == other);
120 }
121#endif
122
123 KOKKOS_FUNCTION constexpr std::size_t size() const
124 {
125 return (1UL * ... * (uid<DDims>(m_element_end) - uid<DDims>(m_element_begin)));
126 }
127
128 KOKKOS_FUNCTION constexpr discrete_vector_type extents() const noexcept
129 {
130 return discrete_vector_type((uid<DDims>(m_element_end) - uid<DDims>(m_element_begin))...);
131 }
132
133 template <class QueryDDim>
134 KOKKOS_FUNCTION constexpr DiscreteVector<QueryDDim> extent() const noexcept
135 {
136 return DiscreteVector<QueryDDim>(
137 uid<QueryDDim>(m_element_end) - uid<QueryDDim>(m_element_begin));
138 }
139
140 KOKKOS_FUNCTION constexpr discrete_element_type front() const noexcept
141 {
142 return m_element_begin;
143 }
144
145 KOKKOS_FUNCTION constexpr discrete_element_type back() const noexcept
146 {
147 return discrete_element_type((uid<DDims>(m_element_end) - 1)...);
148 }
149
150 KOKKOS_FUNCTION constexpr DiscreteDomain take_first(discrete_vector_type n) const
151 {
152 return DiscreteDomain(front(), n);
153 }
154
155 KOKKOS_FUNCTION constexpr DiscreteDomain take_last(discrete_vector_type n) const
156 {
157 return DiscreteDomain(front() + (extents() - n), n);
158 }
159
160 KOKKOS_FUNCTION constexpr DiscreteDomain remove_first(discrete_vector_type n) const
161 {
162 return DiscreteDomain(front() + n, extents() - n);
163 }
164
165 KOKKOS_FUNCTION constexpr DiscreteDomain remove_last(discrete_vector_type n) const
166 {
167 return DiscreteDomain(front(), extents() - n);
168 }
169
171 discrete_vector_type n1,
172 discrete_vector_type n2) const
173 {
174 return DiscreteDomain(front() + n1, extents() - n1 - n2);
175 }
176
177 template <class... ODDims>
178 KOKKOS_FUNCTION constexpr auto restrict_with(DiscreteDomain<ODDims...> const& odomain) const
179 {
180 assert(((uid<ODDims>(m_element_begin) <= uid<ODDims>(odomain.m_element_begin)) && ...));
181 assert(((uid<ODDims>(m_element_end) >= uid<ODDims>(odomain.m_element_end)) && ...));
182 const DiscreteVector<DDims...> myextents = extents();
183 const DiscreteVector<ODDims...> oextents = odomain.extents();
184 return DiscreteDomain(
185 DiscreteElement<DDims...>(
186 (uid_or<DDims>(odomain.m_element_begin, uid<DDims>(m_element_begin)))...),
187 DiscreteVector<DDims...>((get_or<DDims>(oextents, get<DDims>(myextents)))...));
188 }
189
190 KOKKOS_FUNCTION constexpr bool empty() const noexcept
191 {
192 return size() == 0;
193 }
194
195 KOKKOS_FUNCTION constexpr explicit operator bool()
196 {
197 return !empty();
198 }
199
200 template <
201 std::size_t N = sizeof...(DDims),
202 class DDim0 = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
203 KOKKOS_FUNCTION auto begin() const
204 {
205 return DiscreteDomainIterator<DDim0>(front());
206 }
207
208 template <
209 std::size_t N = sizeof...(DDims),
210 class DDim0 = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
211 KOKKOS_FUNCTION auto end() const
212 {
213 return DiscreteDomainIterator<DDim0>(m_element_end);
214 }
215
216 template <
217 std::size_t N = sizeof...(DDims),
218 class DDim0 = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
219 KOKKOS_FUNCTION auto cbegin() const
220 {
221 return DiscreteDomainIterator<DDim0>(front());
222 }
223
224 template <
225 std::size_t N = sizeof...(DDims),
226 class DDim0 = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
227 KOKKOS_FUNCTION auto cend() const
228 {
229 return DiscreteDomainIterator<DDim0>(m_element_end);
230 }
231
232 template <
233 std::size_t N = sizeof...(DDims),
234 class = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
235 KOKKOS_FUNCTION constexpr decltype(auto) operator[](std::size_t n)
236 {
237 return begin()[n];
238 }
239
240 template <
241 std::size_t N = sizeof...(DDims),
242 class = std::enable_if_t<N == 1, std::tuple_element_t<0, std::tuple<DDims...>>>>
243 KOKKOS_FUNCTION constexpr decltype(auto) operator[](std::size_t n) const
244 {
245 return begin()[n];
246 }
247};
248
249template <>
250class DiscreteDomain<>
251{
252 template <class...>
253 friend class DiscreteDomain;
254
255public:
256 using discrete_element_type = DiscreteElement<>;
257
258 using discrete_vector_type = DiscreteVector<>;
259
260 static KOKKOS_FUNCTION constexpr std::size_t rank()
261 {
262 return 0;
263 }
264
265 KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteDomain() = default;
266
267 /// Construct a DiscreteDomain by copies and merge of domains
268 template <class... DDoms, class = std::enable_if_t<(is_discrete_domain_v<DDoms> && ...)>>
269 KOKKOS_FUNCTION constexpr explicit DiscreteDomain([[maybe_unused]] DDoms const&... domains)
270 {
271 }
272
273 /** Construct a DiscreteDomain starting from element_begin with size points.
274 * @param element_begin the lower bound in each direction
275 * @param size the number of points in each direction
276 */
278 [[maybe_unused]] discrete_element_type const& element_begin,
279 [[maybe_unused]] discrete_vector_type const& size)
280 {
281 }
282
284
286
288
290
292
293 KOKKOS_FUNCTION constexpr bool operator==([[maybe_unused]] DiscreteDomain const& other) const
294 {
295 return true;
296 }
297
298#if !defined(__cpp_impl_three_way_comparison) || __cpp_impl_three_way_comparison < 201902L
299 // In C++20, `a!=b` shall be automatically translated by the compiler to `!(a==b)`
300 KOKKOS_FUNCTION constexpr bool operator!=(DiscreteDomain const& other) const
301 {
302 return !(*this == other);
303 }
304#endif
305
306 static KOKKOS_FUNCTION constexpr std::size_t size()
307 {
308 return 1;
309 }
310
311 static KOKKOS_FUNCTION constexpr discrete_vector_type extents() noexcept
312 {
313 return {};
314 }
315
316 static KOKKOS_FUNCTION constexpr discrete_element_type front() noexcept
317 {
318 return {};
319 }
320
321 static KOKKOS_FUNCTION constexpr discrete_element_type back() noexcept
322 {
323 return {};
324 }
325
327 [[maybe_unused]] discrete_vector_type n) const
328 {
329 return *this;
330 }
331
333 [[maybe_unused]] discrete_vector_type n) const
334 {
335 return *this;
336 }
337
339 [[maybe_unused]] discrete_vector_type n) const
340 {
341 return *this;
342 }
343
345 [[maybe_unused]] discrete_vector_type n) const
346 {
347 return *this;
348 }
349
351 [[maybe_unused]] discrete_vector_type n1,
352 [[maybe_unused]] discrete_vector_type n2) const
353 {
354 return *this;
355 }
356
357 template <class... ODims>
359 DiscreteDomain<ODims...> const& /* odomain */) const
360 {
361 return *this;
362 }
363
364 static KOKKOS_FUNCTION constexpr bool empty() noexcept
365 {
366 return false;
367 }
368
369 KOKKOS_FUNCTION constexpr explicit operator bool()
370 {
371 return true;
372 }
373};
374
375template <class... QueryDDims, class... DDims>
376KOKKOS_FUNCTION constexpr DiscreteDomain<QueryDDims...> select(
377 DiscreteDomain<DDims...> const& domain)
378{
379 return DiscreteDomain<QueryDDims...>(
380 DiscreteElement<QueryDDims...>(domain.front()),
381 DiscreteVector<QueryDDims...>(domain.extents()));
382}
383
384namespace detail {
385
386template <class T>
387struct ConvertTypeSeqToDiscreteDomain;
388
389template <class... DDims>
390struct ConvertTypeSeqToDiscreteDomain<detail::TypeSeq<DDims...>>
391{
392 using type = DiscreteDomain<DDims...>;
393};
394
395template <class T>
396using convert_type_seq_to_discrete_domain_t = typename ConvertTypeSeqToDiscreteDomain<T>::type;
397
398} // namespace detail
399
400// Computes the cartesian product of DiscreteDomain types
401// Example usage : "using DDom = cartesian_prod_t<DDom1,DDom2,DDom3>;"
402template <typename... DDoms>
403struct cartesian_prod;
404
405template <typename... DDims1, typename... DDims2, typename... DDomsTail>
406struct cartesian_prod<DiscreteDomain<DDims1...>, DiscreteDomain<DDims2...>, DDomsTail...>
407{
408 using type = typename cartesian_prod<DiscreteDomain<DDims1..., DDims2...>, DDomsTail...>::type;
409};
410
411template <typename... DDims>
412struct cartesian_prod<DiscreteDomain<DDims...>>
413{
414 using type = DiscreteDomain<DDims...>;
415};
416
417template <>
418struct cartesian_prod<>
419{
420 using type = ddc::DiscreteDomain<>;
421};
422
423template <typename... DDoms>
424using cartesian_prod_t = typename cartesian_prod<DDoms...>::type;
425
426// 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)
427template <class... DDimsA, class... DDimsB>
428KOKKOS_FUNCTION constexpr auto remove_dims_of(
429 DiscreteDomain<DDimsA...> const& DDom_a,
430 [[maybe_unused]] DiscreteDomain<DDimsB...> const& DDom_b) noexcept
431{
432 using TagSeqA = detail::TypeSeq<DDimsA...>;
433 using TagSeqB = detail::TypeSeq<DDimsB...>;
434
435 using type_seq_r = type_seq_remove_t<TagSeqA, TagSeqB>;
436 return detail::convert_type_seq_to_discrete_domain_t<type_seq_r>(DDom_a);
437}
438
439//! Remove the dimensions DDimsB from DDom_a
440//! @param[in] DDom_a The discrete domain on which to remove dimensions
441//! @return The discrete domain without DDimsB dimensions
442template <class... DDimsB, class DDomA>
443KOKKOS_FUNCTION constexpr auto remove_dims_of(DDomA const& DDom_a) noexcept
444{
445 using TagSeqA = typename detail::ToTypeSeq<DDomA>::type;
446 using TagSeqB = detail::TypeSeq<DDimsB...>;
447
448 using type_seq_r = type_seq_remove_t<TagSeqA, TagSeqB>;
449 return detail::convert_type_seq_to_discrete_domain_t<type_seq_r>(DDom_a);
450}
451
452// Remove dimensions from a domain type
453template <typename DDom, typename... DDims>
454using remove_dims_of_t = decltype(remove_dims_of<DDims...>(std::declval<DDom>()));
455
456namespace detail {
457
458// 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
459template <typename DDim1, typename DDim2, typename DDimA, typename... DDimsB>
460KOKKOS_FUNCTION constexpr std::conditional_t<
461 std::is_same_v<DDimA, DDim1>,
462 ddc::DiscreteDomain<DDim2>,
463 ddc::DiscreteDomain<DDimA>>
464replace_dim_of_1d(
465 DiscreteDomain<DDimA> const& DDom_a,
466 [[maybe_unused]] DiscreteDomain<DDimsB...> const& DDom_b) noexcept
467{
468 if constexpr (std::is_same_v<DDimA, DDim1>) {
469 return ddc::DiscreteDomain<DDim2>(DDom_b);
470 } else {
471 return DDom_a;
472 }
473}
474
475} // namespace detail
476
477// Replace in DDom_a the dimension Dim1 by the dimension Dim2 of DDom_b
478template <typename DDim1, typename DDim2, typename... DDimsA, typename... DDimsB>
479KOKKOS_FUNCTION constexpr auto replace_dim_of(
480 DiscreteDomain<DDimsA...> const& DDom_a,
481 [[maybe_unused]] DiscreteDomain<DDimsB...> const& DDom_b) noexcept
482{
483 // TODO : static_asserts
484 using TagSeqA = detail::TypeSeq<DDimsA...>;
485 using TagSeqB = detail::TypeSeq<DDim1>;
486 using TagSeqC = detail::TypeSeq<DDim2>;
487
488 using type_seq_r = ddc::type_seq_replace_t<TagSeqA, TagSeqB, TagSeqC>;
489 return ddc::detail::convert_type_seq_to_discrete_domain_t<type_seq_r>(
490 detail::replace_dim_of_1d<
491 DDim1,
492 DDim2,
493 DDimsA,
494 DDimsB...>(ddc::DiscreteDomain<DDimsA>(DDom_a), DDom_b)...);
495}
496
497// Replace dimensions from a domain type
498template <typename DDom, typename DDim1, typename DDim2>
499using replace_dim_of_t
500 = decltype(replace_dim_of<
501 DDim1,
502 DDim2>(std::declval<DDom>(), std::declval<DiscreteDomain<DDim2>>()));
503
504
505template <class... QueryDDims, class... DDims>
506KOKKOS_FUNCTION constexpr DiscreteVector<QueryDDims...> extents(
507 DiscreteDomain<DDims...> const& domain) noexcept
508{
509 return DiscreteVector<QueryDDims...>(DiscreteDomain<QueryDDims>(domain).size()...);
510}
511
512template <class... QueryDDims, class... DDims>
513KOKKOS_FUNCTION constexpr DiscreteElement<QueryDDims...> front(
514 DiscreteDomain<DDims...> const& domain) noexcept
515{
516 return DiscreteElement<QueryDDims...>(DiscreteDomain<QueryDDims>(domain).front()...);
517}
518
519template <class... QueryDDims, class... DDims>
520KOKKOS_FUNCTION constexpr DiscreteElement<QueryDDims...> back(
521 DiscreteDomain<DDims...> const& domain) noexcept
522{
523 return DiscreteElement<QueryDDims...>(DiscreteDomain<QueryDDims>(domain).back()...);
524}
525
526template <class DDim>
528{
529private:
530 DiscreteElement<DDim> m_value = DiscreteElement<DDim>();
531
532public:
533 using iterator_category = std::random_access_iterator_tag;
534
535 using value_type = DiscreteElement<DDim>;
536
537 using difference_type = std::ptrdiff_t;
538
540
541 KOKKOS_FUNCTION constexpr explicit DiscreteDomainIterator(DiscreteElement<DDim> value)
542 : m_value(value)
543 {
544 }
545
546 KOKKOS_FUNCTION constexpr DiscreteElement<DDim> operator*() const noexcept
547 {
548 return m_value;
549 }
550
552 {
553 ++m_value.uid();
554 return *this;
555 }
556
558 {
559 auto tmp = *this;
560 ++*this;
561 return tmp;
562 }
563
565 {
566 --m_value.uid();
567 return *this;
568 }
569
571 {
572 auto tmp = *this;
573 --*this;
574 return tmp;
575 }
576
577 KOKKOS_FUNCTION constexpr DiscreteDomainIterator& operator+=(difference_type n)
578 {
579 if (n >= difference_type(0)) {
580 m_value.uid() += static_cast<DiscreteElementType>(n);
581 } else {
582 m_value.uid() -= static_cast<DiscreteElementType>(-n);
583 }
584 return *this;
585 }
586
587 KOKKOS_FUNCTION constexpr DiscreteDomainIterator& operator-=(difference_type n)
588 {
589 if (n >= difference_type(0)) {
590 m_value.uid() -= static_cast<DiscreteElementType>(n);
591 } else {
592 m_value.uid() += static_cast<DiscreteElementType>(-n);
593 }
594 return *this;
595 }
596
597 KOKKOS_FUNCTION constexpr DiscreteElement<DDim> operator[](difference_type n) const
598 {
599 return m_value + n;
600 }
601
602 friend KOKKOS_FUNCTION constexpr bool operator==(
603 DiscreteDomainIterator const& xx,
604 DiscreteDomainIterator const& yy)
605 {
606 return xx.m_value == yy.m_value;
607 }
608
609#if !defined(__cpp_impl_three_way_comparison) || __cpp_impl_three_way_comparison < 201902L
610 // In C++20, `a!=b` shall be automatically translated by the compiler to `!(a==b)`
611 friend KOKKOS_FUNCTION constexpr bool operator!=(
614 {
615 return xx.m_value != yy.m_value;
616 }
617#endif
618
619 friend KOKKOS_FUNCTION constexpr bool operator<(
620 DiscreteDomainIterator const& xx,
621 DiscreteDomainIterator const& yy)
622 {
623 return xx.m_value < yy.m_value;
624 }
625
626 friend KOKKOS_FUNCTION constexpr bool operator>(
627 DiscreteDomainIterator const& xx,
628 DiscreteDomainIterator const& yy)
629 {
630 return yy < xx;
631 }
632
633 friend KOKKOS_FUNCTION constexpr bool operator<=(
634 DiscreteDomainIterator const& xx,
635 DiscreteDomainIterator const& yy)
636 {
637 return !(yy < xx);
638 }
639
640 friend KOKKOS_FUNCTION constexpr bool operator>=(
641 DiscreteDomainIterator const& xx,
642 DiscreteDomainIterator const& yy)
643 {
644 return !(xx < yy);
645 }
646
649 difference_type n)
650 {
651 return i += n;
652 }
653
655 difference_type n,
657 {
658 return i += n;
659 }
660
663 difference_type n)
664 {
665 return i -= n;
666 }
667
668 friend KOKKOS_FUNCTION constexpr difference_type operator-(
669 DiscreteDomainIterator const& xx,
670 DiscreteDomainIterator const& yy)
671 {
672 return (yy.m_value > xx.m_value) ? (-static_cast<difference_type>(yy.m_value - xx.m_value))
673 : (xx.m_value - yy.m_value);
674 }
675};
676
677} // namespace ddc
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 remove(discrete_vector_type n1, discrete_vector_type n2) const
KOKKOS_FUNCTION constexpr DiscreteDomain take_last(discrete_vector_type n) const
static KOKKOS_FUNCTION constexpr std::size_t rank()
KOKKOS_DEFAULTED_FUNCTION DiscreteDomain(DiscreteDomain const &x)=default
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
KOKKOS_FUNCTION constexpr DiscreteDomain remove_last(discrete_vector_type n) const
static KOKKOS_FUNCTION constexpr discrete_element_type back() noexcept
static KOKKOS_FUNCTION constexpr discrete_element_type front() noexcept
KOKKOS_FUNCTION constexpr DiscreteDomain take_first(discrete_vector_type n) const
KOKKOS_DEFAULTED_FUNCTION DiscreteDomain & operator=(DiscreteDomain const &x)=default
KOKKOS_FUNCTION constexpr DiscreteDomain(DDoms const &... domains)
Construct a DiscreteDomain by copies and merge of domains.
KOKKOS_FUNCTION constexpr bool operator==(DiscreteDomain const &other) const
KOKKOS_FUNCTION constexpr DiscreteDomain remove_first(discrete_vector_type n) const
KOKKOS_FUNCTION constexpr DiscreteDomain restrict_with(DiscreteDomain< ODims... > const &) const
KOKKOS_DEFAULTED_FUNCTION DiscreteDomain(DiscreteDomain &&x)=default
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 constexpr DiscreteDomain take_last(discrete_vector_type n) const
KOKKOS_FUNCTION auto begin() const
KOKKOS_FUNCTION constexpr DiscreteDomain remove(discrete_vector_type n1, discrete_vector_type n2) 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_FUNCTION constexpr DiscreteDomain(DDoms const &... domains)
Construct a DiscreteDomain by copies and merge of domains.
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 auto cbegin() const
KOKKOS_FUNCTION auto end() const
KOKKOS_FUNCTION constexpr DiscreteDomain take_first(discrete_vector_type n) const
KOKKOS_DEFAULTED_FUNCTION ~DiscreteDomain()=default
KOKKOS_FUNCTION auto cend() const
KOKKOS_FUNCTION constexpr decltype(auto) operator[](std::size_t n) const
KOKKOS_FUNCTION constexpr discrete_element_type back() const noexcept
KOKKOS_DEFAULTED_FUNCTION DiscreteDomain & operator=(DiscreteDomain const &x)=default
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 decltype(auto) operator[](std::size_t n)
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteElement()=default
KOKKOS_FUNCTION constexpr bool operator!=(DiscreteVector< OTags... > const &rhs) const noexcept
KOKKOS_DEFAULTED_FUNCTION constexpr DiscreteVector()=default
The top-level namespace of DDC.
KOKKOS_FUNCTION constexpr DiscreteElement< QueryDDims... > back(DiscreteDomain< DDims... > const &domain) noexcept
KOKKOS_FUNCTION constexpr DiscreteElement< QueryDDims... > front(DiscreteDomain< DDims... > const &domain) noexcept
KOKKOS_FUNCTION constexpr auto remove_dims_of(DDomA const &DDom_a) noexcept
Remove the dimensions DDimsB from DDom_a.
KOKKOS_FUNCTION constexpr DiscreteVector< QueryDDims... > extents(DiscreteDomain< DDims... > const &domain) noexcept
KOKKOS_FUNCTION constexpr auto remove_dims_of(DiscreteDomain< DDimsA... > const &DDom_a, DiscreteDomain< DDimsB... > const &DDom_b) noexcept
KOKKOS_FUNCTION constexpr auto replace_dim_of(DiscreteDomain< DDimsA... > const &DDom_a, DiscreteDomain< DDimsB... > const &DDom_b) noexcept
constexpr bool is_discrete_domain_v
KOKKOS_FUNCTION constexpr DiscreteDomain< QueryDDims... > select(DiscreteDomain< DDims... > const &domain)
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)