17 #ifndef OPENKALMAN_CHECK_BLOCK_LIMITS_HPP 18 #define OPENKALMAN_CHECK_BLOCK_LIMITS_HPP 25 template<std::size_t limit_ix, std::size_t
index,
typename Arg,
typename...Limits>
26 constexpr
void check_block_limit(
const Arg& arg,
const Limits&...)
28 if constexpr (((limit_ix >= std::tuple_size_v<Limits>) or ...))
return;
29 else if constexpr (((
values::fixed<std::tuple_element_t<limit_ix, Limits>>) and ...) and not dynamic_dimension<Arg, index>)
31 constexpr std::size_t block_limit = (
static_cast<std::size_t
>(std::decay_t<std::tuple_element_t<limit_ix, Limits>>
::value) + ... + 0_uz);
32 static_assert(block_limit <= index_dimension_of_v<Arg, index>,
"Block limits must be in range");
49 template<std::size_t...limit_ix, std::size_t...indices,
typename Arg,
typename...Limits>
50 constexpr
void check_block_limits(
51 std::index_sequence<limit_ix...>, std::index_sequence<indices...>,
const Arg& arg,
const Limits&...limits)
53 (detail::check_block_limit<limit_ix, indices>(arg, limits...), ...);
58 #endif //OPENKALMAN_CHECK_BLOCK_LIMITS_HPP constexpr bool value
T is numerical value or is reducible to a numerical value.
Definition: value.hpp:31
constexpr bool fixed
T is a values::value that is determinable at compile time.
Definition: fixed.hpp:60
Definition: basics.hpp:48
constexpr bool index
An object describing a collection of /ref values::index objects.
Definition: index.hpp:75