16 #ifndef OPENKALMAN_UNIFORM_PATTERN_HPP 17 #define OPENKALMAN_UNIFORM_PATTERN_HPP 27 template<
typename T,
typename C =
void, std::
size_t i = 0>
29 heterogeneous_pattern_impl()
31 if constexpr (i < collections::size_of_v<T>)
33 using A = common_descriptor_type_t<collections::collection_element_t<i, T>>;
36 return heterogeneous_pattern_impl<T, A, i + 1>();
40 constexpr
auto dA = dimension_of_v<A>;
41 if constexpr ((dA != stdex::dynamic_extent and dA != 1) or not compares_with<C, A, &stdex::is_eq, applicability::permitted>)
42 return std::true_type {};
43 else if constexpr (dA != stdex::dynamic_extent and dimension_of_v<C> == stdex::dynamic_extent)
44 return heterogeneous_pattern_impl<T, A, i + 1>();
46 return heterogeneous_pattern_impl<T, C, i + 1>();
51 return std::false_type{};
59 template<
typename T,
typename =
void>
65 template<descriptor T>
72 (not euclidean_pattern<T>) and
73 (dimension_of_v<T> != stdex::dynamic_extent) and
74 (dimension_of_v<T> != 1)
79 template<descriptor_collection T> requires
80 collections::sized<T> and
81 (collections::size_of_v<T> != stdex::dynamic_extent) and
82 (collections::size_of_v<T> > 1) and
83 collections::uniformly_gettable<T>
88 descriptor_collection<T> and
89 values::fixed_value_compares_with<collections::size_of<T>, stdex::dynamic_extent, &stdex::is_neq> and
90 values::fixed_value_compares_with<collections::size_of<T>, 1, &stdex::is_gt> and
91 collections::uniformly_gettable<T>
94 : std::bool_constant<heterogeneous_pattern_impl<T>()> {};
98 template<descriptor_collection T> requires
99 (not collections::uniformly_gettable<T>) and
106 descriptor_collection<T> and
107 (not collections::uniformly_gettable<T>) and
108 values::fixed_value_compares_with<dimension_of<common_descriptor_type_t<T>>, stdex::dynamic_extent, &stdex::is_neq> and
109 values::fixed_value_compares_with<dimension_of<common_descriptor_type_t<T>>, 1, &stdex::is_neq>
115 #ifndef __cpp_concepts 116 template<
typename T,
typename =
void>
131 template<
typename T, applicability a = applicability::guaranteed>
132 #ifdef __cpp_concepts 137 constexpr
bool uniform_pattern =
typename common_descriptor_type< T >::type common_descriptor_type_t
Helper template for common_descriptor_type.
Definition: common_descriptor_type.hpp:126
Definition for compares_with.
The concept, trait, or restraint represents a compile-time guarantee.
The concept, trait, or restraint is permitted, but whether it applies is not necessarily known at com...
constexpr auto dimension_of_v
Helper template for coordinates::dimension_of.
Definition: dimension_of.hpp:56
Definition: uniform_pattern.hpp:61
The namespace for features relating to coordinates::pattern object.
Definition: compares_with.hpp:25
Inclusion file for collections.
constexpr bool uniform_pattern
T is a coordinates::pattern that is either empty or can be decomposed into a uniform set of 1D coordi...
Definition: uniform_pattern.hpp:137