16 #ifndef OPENKALMAN_SQUARE_SHAPED_HPP 17 #define OPENKALMAN_SQUARE_SHAPED_HPP 25 template<
typename T, std::size_t I, std::size_t...Is>
26 constexpr
bool maybe_square_shaped(std::index_sequence<I, Is...>)
28 return (... and compares_with<vector_space_descriptor_of_t<T, I>, vector_space_descriptor_of_t<T, Is>, equal_to<>,
Applicability::permitted>);
32 #ifndef __cpp_concepts 33 template<
typename T, Applicability b,
typename =
void>
36 template<
typename T, Applicability b>
37 struct square_shaped_impl<T, b,
std::enable_if_t<indexible<T> and (index_count<T>::value != dynamic_size) and (index_count<T>::value > 1)>>
38 : std::bool_constant<(b != Applicability::guaranteed or not has_dynamic_dimensions<T>) and
39 (index_count_v<T> != 1 or dimension_size_of_index_is<T, 0, 1, Applicability::permitted>) and
40 (index_count_v<T> < 2 or maybe_square_shaped<T>(std::make_index_sequence<index_count_v<T>>{}))> {};
46 #ifndef __cpp_concepts
49 template<typename T, Applicability b, typename = void>
50 struct is_explicitly_square : std::false_type {};
52 template<typename T, Applicability b>
53 struct is_explicitly_square<T, b, std::enable_if_t<interface::indexible_object_traits<std::decay_t<T>>::template is_square<b>>>
57 template<typename T, TriangleType t, typename = void>
58 struct is_explicitly_triangular : std::false_type {};
60 template<typename T, TriangleType t>
61 struct is_explicitly_triangular<T, t, std::enable_if_t<interface::indexible_object_traits<std::decay_t<T>>::template is_triangular<t>>>
75 template<typename T, Applicability b = Applicability::guaranteed>
77 concept square_shaped = one_dimensional<T, b> or (indexible<T> and
78 (not interface::is_square_defined_for<T, b> or interface::indexible_object_traits<std::decay_t<T>>::template is_square<b>) and
79 (interface::is_square_defined_for<T, b> or ((b != Applicability::guaranteed or not has_dynamic_dimensions<T>) and
80 (index_count_v<T> != 1 or dimension_size_of_index_is<T, 0, 1, Applicability::permitted>) and
81 (index_count_v<T> < 2 or detail::maybe_square_shaped<T>(std::make_index_sequence<index_count_v<T>>{}))) or
82 (b == Applicability::guaranteed and interface::indexible_object_traits<std::decay_t<T>>::template is_triangular<TriangleType::any, b>)));
84 constexpr bool square_shaped = one_dimensional<T, b> or (indexible<T> and
85 (not interface::is_square_defined_for<T, b> or internal::is_explicitly_square<T, b>::value) and
86 (interface::is_square_defined_for<T, b> or detail::square_shaped_impl<T, b>::value or
87 (b == Applicability::guaranteed and internal::is_explicitly_triangular<T, TriangleType::any>::value)));
Definition: square_shaped.hpp:34
Definition for compares_with.
Definition: tuple_reverse.hpp:103
The root namespace for OpenKalman.
Definition: basics.hpp:34
The concept, trait, or restraint is permitted, but whether it applies is not necessarily known at com...