9 template <
unsigned Dim>
10 template <
class... Args>
13 static_assert(
Dim ==
sizeof...(args),
"Wrong number of arguments.");
16 template <
unsigned Dim>
19 for (
auto& index : indices) {
25 template <
unsigned Dim>
27 for (
unsigned int d = 0; d <
Dim; ++d) {
32 template <
unsigned Dim>
37 template <
unsigned Dim>
42 template <
unsigned Dim>
45 for (
unsigned int d = 1; d <
Dim; ++d) {
51 template <
unsigned Dim>
54 for (
unsigned d = 0; d <
Dim; ++d) {
60 template <
unsigned Dim>
63 for (
unsigned d = 0; d <
Dim; ++d) {
64 out << idx[d] << ((d ==
Dim - 1) ?
'}' :
',');
69 template <
unsigned Dim>
72 for (
unsigned d = 0; d <
Dim; ++d) {
78 template <
unsigned Dim>
81 for (
unsigned d = 0; d <
Dim; ++d) {
87 template <
unsigned Dim>
94 template <
unsigned Dim>
97 for (
unsigned int d = 0; (d <
Dim) && touch; ++d) {
103 template <
unsigned Dim>
106 for (
unsigned int d = 0; (d <
Dim) && cont; ++d) {
112 template <
unsigned Dim>
121 return indices_m[d].split(l[d], r[d], i);
124 template <
unsigned Dim>
133 return indices_m[d].split(l[d], r[d], a);
136 template <
unsigned Dim>
148 template <
unsigned Dim>
150 unsigned int max_dim = 0;
151 unsigned int max_length = 0;
152 for (
unsigned int d = 0; d <
Dim; ++d) {
158 return split(l, r, max_dim);
161 template <
unsigned Dim>
163 auto construct = [&]<
size_t... Idx>(
const std::index_sequence<Idx...>&) {
166 return construct(std::make_index_sequence<Dim>{});
169 template <
unsigned Dim>
171 auto construct = [&]<
size_t... Idx>(
const std::index_sequence<Idx...>&) {
174 return construct(std::make_index_sequence<Dim>{});
177 template <
unsigned Dim>
179 auto construct = [&]<
size_t... Idx>(
const std::index_sequence<Idx...>&) {
182 return construct(std::make_index_sequence<Dim>{});
185 template <
unsigned Dim>
190 template <
unsigned Dim>
195 template <
unsigned Dim>
201 template <
unsigned Dim>
207 template <
unsigned Dim>
209 for (
unsigned d = 0; d <
Dim; d++) {
210 if (nd1[d] != nd2[d]) {
217 template <
unsigned Dim>
219 return !(nd1 == nd2);
bool operator!=(const NDIndex< Dim > &nd1, const NDIndex< Dim > &nd2)
bool operator==(const NDIndex< Dim > &nd1, const NDIndex< Dim > &nd2)
std::ostream & operator<<(std::ostream &os, const BConds< Field, Dim > &bc)
const Index * const_iterator
KOKKOS_INLINE_FUNCTION constexpr iterator begin()
KOKKOS_INLINE_FUNCTION bool touches(const NDIndex< Dim > &) const
KOKKOS_INLINE_FUNCTION bool empty() const noexcept
KOKKOS_INLINE_FUNCTION Vector< int, Dim > last() const
KOKKOS_INLINE_FUNCTION unsigned size() const noexcept
KOKKOS_INLINE_FUNCTION Vector< int, Dim > first() const
KOKKOS_FUNCTION NDIndex()
KOKKOS_INLINE_FUNCTION const ippl::Index & operator[](unsigned d) const noexcept
KOKKOS_INLINE_FUNCTION bool split(NDIndex< Dim > &l, NDIndex< Dim > &r, unsigned d, int i) const
KOKKOS_INLINE_FUNCTION NDIndex< Dim > intersect(const NDIndex< Dim > &) const
Index indices_m[Dim]
Array of indices.
KOKKOS_INLINE_FUNCTION bool contains(const NDIndex< Dim > &a) const
KOKKOS_INLINE_FUNCTION Vector< size_t, Dim > length() const
KOKKOS_INLINE_FUNCTION constexpr iterator end()
KOKKOS_INLINE_FUNCTION NDIndex< Dim > grow(int ncells) const