16 #ifndef OPENKALMAN_COORDINATES_GET_DIMENSION_HPP 17 #define OPENKALMAN_COORDINATES_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<pattern Arg> requires descriptor<Arg> or collections::sized<Arg>
50 template<
typename Arg, std::enable_if_t<pattern<Arg> and
51 (descriptor<Arg> or collections::sized<Arg>),
int> = 0>
56 if constexpr (descriptor<Arg>)
58 return internal::get_descriptor_dimension(arg);
62 return std::integral_constant<std::size_t, 0_uz>{};
66 return detail::get_dimension_fixed(arg);
71 if constexpr (values::fixed_value_compares_with<C, 0_uz>)
73 return std::integral_constant<std::size_t, 0_uz>{};
75 else if constexpr (values::fixed<C>)
81 #ifdef __cpp_lib_ranges_fold 83 [](
const auto& a,
const auto& b) {
return a + internal::get_descriptor_dimension(b); });
85 std::size_t ret = 0_uz;
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
Definition for coordinates::pattern.
constexpr auto get_dimension(const Arg &arg)
Get the vector dimension of coordinates::pattern Arg.
Definition: get_dimension.hpp:54
Definition for coordinates::descriptor.
The namespace for features relating to coordinates::pattern object.
Definition: compares_with.hpp:25
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:72
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_size(Arg &&arg)
Get the size of a sized object (e.g, a collection)
Definition: get_size.hpp:188
constexpr auto operation(Operation &&op, Args &&...args)
A potentially constant-evaluated operation involving some number of values.
Definition: operation.hpp:98