11#include "ddc/discrete_domain.hpp"
12#include "ddc/discrete_element.hpp"
13#include "ddc/discrete_vector.hpp"
19template <
class Support,
class Element, std::size_t N,
class Functor,
class... Is>
21 Support
const& support,
22 std::array<Element, N>
const& size,
24 Is
const&... is)
noexcept
26 static constexpr std::size_t I =
sizeof...(Is);
27 if constexpr (I == N) {
28 f(support(
typename Support::discrete_vector_type(is...)));
30 for (Element ii = 0; ii < size[I]; ++ii) {
31 for_each_serial(support, size, f, is..., ii);
39
40
41
42template <
class Support,
class Functor>
43void for_each(Support
const& domain, Functor&& f)
noexcept
45 std::array
const size = detail::array(domain.extents());
46 detail::for_each_serial(domain, size, std::forward<Functor>(f));
The top-level namespace of DDC.
void for_each(Support const &domain, Functor &&f) noexcept
iterates over a nD domain in serial