7 #ifndef NIHU_M2L_INDICES_HPP_INCLUDED
8 #define NIHU_M2L_INDICES_HPP_INCLUDED
12 #include <type_traits>
20 template <
unsigned Dim>
24 static size_t const dimension = Dim;
29 static size_t drel2idx(location_t
const &drel, std::integral_constant<size_t, 1U>)
31 return size_t(round(drel(0)) + 3);
34 static size_t drel2idx(location_t
const &drel, std::integral_constant<size_t, 2U>)
36 return size_t(round(drel(0)) + 3 + 7 * (round(drel(1)) + 3));
39 static size_t drel2idx(location_t
const &drel, std::integral_constant<size_t, 3U>)
41 return size_t(round(drel(0)) + 3 + 7 * (round(drel(1)) + 3) + 7 * 7 * (round(drel(2)) + 3));
48 return drel2idx(drel, std::integral_constant<size_t, dimension>());