16 #ifndef OPENKALMAN_TENSOR_ORDER_HPP 17 #define OPENKALMAN_TENSOR_ORDER_HPP 19 #include "coordinates/coordinates.hpp" 31 return std::integral_constant<std::size_t, 0>{};
34 template<std::size_t I, std::size_t...Is,
typename T>
37 auto dim = get_index_extent<I>(t);
41 if constexpr (stat_dim == 0) return dim;
45 if constexpr (stat_dim == 1) return next;
46 else return values::
operation(
std::plus{}, std::integral_constant<std::size_t, 1>{}, next);
51 if (dim == 0)
return dim;
55 if (dim == 1)
return next;
56 else return 1_uz + next;
74 template<
typename T, std::enable_if_t<indexible<T>,
int> = 0>
81 constexpr std::make_index_sequence<std::decay_t<decltype(count_indices(t))>::value> seq;
82 return detail::get_tensor_order_of_impl(seq, t);
86 std::size_t count = 0;
91 else if (dim == 0)
return 0;
constexpr auto count_indices(const T &)
Get the number of indices necessary to address all the components of an indexible object...
Definition: count_indices.hpp:51
Definition of get_index_extent function.
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45
Definition of count_indices.
constexpr auto tensor_order(const T &t)
Return the tensor order of T (i.e., the number of indices of dimension greater than 1)...
Definition: tensor_order.hpp:77
constexpr auto get_index_extent(T &&t, I i=I{})
Get the runtime dimensions of index N of indexible T.
Definition: get_index_extent.hpp:36
The root namespace for OpenKalman.
Definition: basics.hpp:34
Definition: trait_backports.hpp:64
constexpr bool index
T is an index value.
Definition: index.hpp:62
constexpr bool fixed
T is a value that is determinable at compile time.
Definition: fixed.hpp:66
constexpr auto operation(Operation &&op, Args &&...args)
A potentially constant-evaluated operation involving some number of values.
Definition: operation.hpp:98