16 #ifndef OPENKALMAN_GET_EUCLIDEAN_DIMENSION_HPP 17 #define OPENKALMAN_GET_EUCLIDEAN_DIMENSION_HPP 30 #ifndef __cpp_lib_ranges 31 template<
typename T,
typename =
void>
36 : std::bool_constant<values::fixed_value_compares_with<decltype(internal::get_descriptor_stat_dimension(
37 std::declval<stdex::ranges::range_value_t<T>>())), 0>> {};
41 template<std::
size_t i = 0,
typename T>
42 static constexpr
auto get_stat_dimension_fixed(
const T& t)
44 if constexpr (i < collections::size_of_v<T>)
48 internal::get_descriptor_stat_dimension(collections::get<i>(t)),
49 get_stat_dimension_fixed<i + 1>(t));
51 else return std::integral_constant<std::size_t, 0_uz>{};
61 template<sized_pattern Arg> requires descriptor<Arg> or collections::sized<Arg> or
62 values::fixed_value_compares_with<decltype(internal::get_descriptor_stat_dimension(std::declval<stdex::ranges::range_value_t<Arg>>())), 0>
65 template<
typename Arg, std::enable_if_t<descriptor<Arg> or
71 if constexpr (descriptor<Arg>)
73 return internal::get_descriptor_stat_dimension(arg);
77 return std::integral_constant<std::size_t, 0_uz>{};
81 return detail::get_stat_dimension_fixed(arg);
85 using C = decltype(internal::get_descriptor_stat_dimension(std::declval<stdex::ranges::range_value_t<Arg>>()));
86 if constexpr (values::fixed_value_compares_with<C, 0_uz>)
87 return std::integral_constant<std::size_t, 0_uz>{};
88 else if constexpr (values::fixed<C>)
91 #ifdef __cpp_lib_ranges_fold 93 [](
const auto& a,
const auto& b) {
return a + internal::get_descriptor_stat_dimension(b); });
96 std::size_t ret = 0_uz;
Definition: get_stat_dimension.hpp:32
constexpr auto get_size(Arg &&arg)
Get the size of a sized object (e.g, a collection)
Definition: get_size.hpp:224
Definition for patterns::sized_pattern.
The size of a sized object (including a collection).
Definition: size_of.hpp:33
The namespace for features relating to patterns::pattern object.
Definition: collection_compares_with.hpp:24
Definition for patterns::descriptor.
constexpr detail::all_closure all
a std::ranges::range_adaptor_closure which returns a view to all members of its collection argument...
Definition: all.hpp:70
constexpr bool fixed_value_compares_with
T has a fixed value that compares with N in a particular way based on parameter comp.
Definition: fixed_value_compares_with.hpp:74
constexpr bool index
T is an index value.
Definition: index.hpp:62
Basic definitions for OpenKalman as a whole.
constexpr auto get_stat_dimension(const Arg &arg)
Get the vector dimension of patterns::pattern Arg when transformed into statistical space...
Definition: get_stat_dimension.hpp:69
constexpr auto operation(Operation &&op, Args &&...args)
A potentially constant-evaluated operation involving some number of values.
Definition: operation.hpp:98