16 #ifndef OPENKALMAN_DESCRIPTORS_GET_EUCLIDEAN_INDEX_TABLE_HPP 17 #define OPENKALMAN_DESCRIPTORS_GET_EUCLIDEAN_INDEX_TABLE_HPP 20 #include "collections/views/internal/repeat_tuple_view.hpp" 31 template<std::size_t c = 0, std::size_t local = 0,
typename Tup, std::size_t...is>
33 euclidean_index_table_tuple(
const Tup& tup, std::index_sequence<is...> seq = std::index_sequence<>{})
35 if constexpr (c < std::tuple_size_v<Tup>)
37 if constexpr (local < stat_dimension_of_v<std::tuple_element_t<c, Tup>>)
38 return euclidean_index_table_tuple<c, local + 1>(tup,
std::index_sequence<is..., c>{});
40 return euclidean_index_table_tuple<c + 1, 0>(tup, seq);
42 else return std::tuple {std::integral_constant<std::size_t, is>{}...};
53 #ifdef __cpp_lib_constexpr_vector 57 template<
typename Arg, std::enable_if_t<pattern<Arg>,
int> = 0>
64 if constexpr (descriptor<Arg>)
71 return detail::euclidean_index_table_tuple(arg);
76 std::vector<std::size_t> table;
78 for (
auto& comp : arg)
80 for (std::size_t local = 0; local < get_descriptor_stat_dimension(comp); ++local) table.emplace_back(c);
91 #endif //OPENKALMAN_DESCRIPTORS_GET_EUCLIDEAN_INDEX_TABLE_HPP Definition: get_component_start_indices.hpp:29
auto get_euclidean_index_table(Arg &&arg)
A collection mapping each index of an indexible vector, transformed to statistical space) to a corres...
Definition: get_euclidean_index_table.hpp:60
Definition: tuple_reverse.hpp:103
Definition for coordinates::pattern.
constexpr auto to_number(Arg arg)
Convert any values::value to a values::number.
Definition: to_number.hpp:34
Definition for coordinates::descriptor.
Definition: tuple_fill_view.hpp:32
Definition for coordinates::stat_dimension_of.
Definition for collections::index.
constexpr std::size_t dynamic_size
A constant indicating that a size or index is dynamic.
Definition: global-definitions.hpp:33
constexpr bool index
An object describing a collection of /ref values::index objects.
Definition: index.hpp:75