16 #ifndef OPENKALMAN_PATTERNS_GET_DIMENSION_HPP 17 #define OPENKALMAN_PATTERNS_GET_DIMENSION_HPP 28 template<std::
size_t i = 0,
typename T>
29 static constexpr
auto get_dimension_fixed(
const T& t)
31 if constexpr (i < collections::size_of_v<T>)
35 internal::get_descriptor_dimension(collections::get<i>(t)),
36 get_dimension_fixed<i + 1>(t));
38 else return std::integral_constant<std::size_t, 0_uz>{};
47 template<sized_pattern Arg>
50 template<
typename Arg, std::enable_if_t<sized_pattern<Arg>,
int> = 0>
55 if constexpr (descriptor<Arg>)
57 return internal::get_descriptor_dimension(arg);
61 return std::integral_constant<std::size_t, 0_uz>{};
65 return detail::get_dimension_fixed(arg);
70 if constexpr (values::fixed_value_compares_with<C, 0_uz>)
71 return std::integral_constant<std::size_t, 0_uz>{};
72 else if constexpr (values::fixed<C>)
75 #ifdef __cpp_lib_ranges_fold 77 [](
const auto& a,
const auto& b) {
return a + internal::get_descriptor_dimension(b); });
80 std::size_t ret = 0_uz;
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.
typename common_collection_type< T >::type common_collection_type_t
Helper template for common_collection_type.
Definition: common_collection_type.hpp:81
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
Inclusion file for collections.
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
constexpr auto get_dimension(const Arg &arg)
Get the vector dimension of patterns::pattern Arg.
Definition: get_dimension.hpp:53
constexpr auto operation(Operation &&op, Args &&...args)
A potentially constant-evaluated operation involving some number of values.
Definition: operation.hpp:98