16 #ifndef OPENKALMAN_SQUARE_SHAPED_HPP 17 #define OPENKALMAN_SQUARE_SHAPED_HPP 19 #include "coordinates/coordinates.hpp" 20 #include "../interfaces/object_traits.hpp" 28 #ifndef __cpp_concepts 29 template<
typename T, applicability b,
typename =
void>
32 template<
typename T, applicability b>
33 struct is_explicitly_square<T, b,
std::enable_if_t<interface::object_traits<stdex::remove_cvref_t<T>>::template is_square<b>>>
37 template<
typename T, std::
size_t i>
41 if constexpr (i == 0)
return i;
43 else return best_square_index<T, i - 1>();
51 constexpr std::size_t best = best_square_index<T,
sizeof...(is)>();
52 using best_patt = decltype(get_index_pattern<best>(std::declval<T>()));
53 return (... and (is == best or
58 template<
typename T, applicability b>
62 if constexpr (not indexible<T>)
64 else if constexpr (index_count_v<T> == 1)
65 return index_dimension_of_v<T, 0> == 1;
67 return detail::square_shaped_fixed_index_count<T, b>(std::make_index_sequence<index_count_v<T>>{});
81 template<
typename T, applicability b = applicability::guaranteed>
85 (not interface::is_square_defined_for<T, b> or
87 (interface::is_square_defined_for<T, b> or
88 detail::square_shaped_impl<T, b>());
90 constexpr
bool square_shaped =
92 (interface::is_square_defined_for<T, b> ?
94 detail::square_shaped_impl<T, b>());
applicability
The applicability of a concept, trait, or restraint.
Definition: constants.hpp:35
The root namespace for OpenKalman.
Definition: basics.hpp:34
Definition: object_traits.hpp:38
constexpr bool fixed_pattern
A coordinates::pattern for which the dimension is fixed at compile time.
Definition: fixed_pattern.hpp:46
Definition: square_shaped.hpp:30
Definition for index_count.
Definition of get_index_pattern function.
Definition: trait_backports.hpp:64
constexpr bool compares_with
Compares two coordinates::pattern objects.
Definition: compares_with.hpp:475
constexpr bool square_shaped
Specifies that an object is square (i.e., has equivalent coordinates::pattern along each dimension)...
Definition: square_shaped.hpp:90