OpenKalman
uniform_pattern_type.hpp
Go to the documentation of this file.
1 /* This file is part of OpenKalman, a header-only C++ library for
2  * Kalman filters and other recursive filters.
3  *
4  * Copyright (c) 2019-2025 Christopher Lee Ogden <ogden@gatech.edu>
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
9  */
10 
16 #ifndef OPENKALMAN_COORDINATES_UNIFORM_PATTERN_TYPE_HPP
17 #define OPENKALMAN_COORDINATES_UNIFORM_PATTERN_TYPE_HPP
18 
24 
26 {
32 #ifdef __cpp_concepts
33  template<typename T>
34 #else
35  template<typename T, typename = void>
36 #endif
38 
39 
40 #ifndef __cpp_concepts
41  namespace detail
42  {
43  template<typename T, typename = void>
44  struct common_descriptor_dimension_is_1 : std::false_type {};
45 
46  template<typename T>
47  struct common_descriptor_dimension_is_1<T, std::void_t<typename common_descriptor_type<T>::type>>
48  : std::bool_constant<values::fixed_value_compares_with<dimension_of<common_descriptor_type_t<T>>, 1>> {};
49  }
50 #endif
51 
52 
54 #ifdef __cpp_concepts
55  template<pattern T> requires
56  euclidean_pattern<T> or
57  values::fixed_value_compares_with<dimension_of<typename common_descriptor_type<T>::type>, 1>
58  struct uniform_pattern_type<T>
59 #else
60  template<typename T>
61  struct uniform_pattern_type<T, std::enable_if_t<
62  pattern<T> and (euclidean_pattern<T> or detail::common_descriptor_dimension_is_1<T>::value)>>
63 #endif
64  : std::conditional_t<
65  euclidean_pattern<T>,
66  stdex::type_identity<Dimensions<1>>,
67  common_descriptor_type<T>> {};
68 
69 
73  template<typename T>
75 
76 
77 }
78 
79 #endif
Definition for coordinates::euclidean_pattern.
If T is a uniform_pattern, type is an alias for the uniform component.
Definition: uniform_pattern_type.hpp:37
Definition of the Dimensions class.
The namespace for features relating to coordinates::pattern object.
Definition: compares_with.hpp:25
Inclusion file for collections.
typename uniform_pattern_type< T >::type uniform_pattern_type_t
Helper template for uniform_pattern_type.
Definition: uniform_pattern_type.hpp:74
Definition for coordinates::dimension_of.
Definition for collections::common_descriptor_type.