16 #ifndef OPENKALMAN_GET_PATTERN_COLLECTION_HPP 17 #define OPENKALMAN_GET_PATTERN_COLLECTION_HPP 19 #include "coordinates/coordinates.hpp" 28 template<std::
size_t i,
typename Mdspan>
30 get_extent(
const Mdspan& m)
32 constexpr
auto ex = Mdspan::static_extent(i);
33 if constexpr (ex == stdex::dynamic_extent)
36 return std::integral_constant<std::size_t, ex>{};
39 template<
typename Mdspan, std::size_t...i>
43 return std::tuple {get_extent<i>(m)...};
56 template<
typename T, std::enable_if_t<indexible<T>,
int> = 0>
57 constexpr decltype(
auto)
61 using Td = stdex::remove_cvref_t<T>;
62 if constexpr (interface::get_pattern_collection_defined_for<Td>)
70 return detail::get_pattern_collection_impl(
get_mdspan(t), std::make_index_sequence<index_count_v<T>>{});
constexpr auto get_mdspan(T &t)
Get the coordinates::pattern_collection associated with indexible object T.
Definition: get_mdspan.hpp:35
decltype(auto) constexpr get_pattern_collection(T &&t)
Get the coordinates::pattern_collection associated with indexible object T.
Definition: get_pattern_collection.hpp:59
The size of a coordinates::pattern.
Definition: dimension_of.hpp:36
The root namespace for OpenKalman.
Definition: basics.hpp:34
Definition: object_traits.hpp:38
Definition of get_mdspan function.
constexpr bool size_compares_with
T and U are sizes that compare in a particular way based on parameter comp.
Definition: size_compares_with.hpp:98
Definition for index_count.
constexpr bool pattern_collection
An object describing a collection of /ref pattern objects.
Definition: pattern_collection.hpp:65
Definition: trait_backports.hpp:64
The minimum number of indices needed to access all the components of an object (i.e., the rank or order).
Definition: index_count.hpp:34
Concepts for testing whether object_traits or library_interface definitions exist for a particular ob...