OpenKalman
uniform_static_vector_space_descriptor_query.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-2024 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 
17 #ifndef OPENKALMAN_UNIFORM_FIXED_VECTOR_SPACE_DESCRIPTOR_QUERY_HPP
18 #define OPENKALMAN_UNIFORM_FIXED_VECTOR_SPACE_DESCRIPTOR_QUERY_HPP
19 
20 #include <type_traits>
27 
28 
30 {
31 #ifdef __cpp_concepts
32  template<typename C>
33 #else
34  template<typename C, typename = void>
35 #endif
36  struct uniform_static_vector_space_descriptor_query : std::false_type {};
37 
38 
39 #ifdef __cpp_concepts
40  template<descriptor C> requires
41  (dimension_of_v<C> == 1) and (not euclidean_pattern<C>)
43 #else
44  template<typename C>
45  struct uniform_static_vector_space_descriptor_query<C, std::enable_if_t<descriptor<C> and
46  (dimension_of_v<C> == 1) and (not euclidean_pattern<C>)>>
47 #endif
48  : std::true_type { using uniform_type = C; };
49 
50 
51 #ifdef __cpp_concepts
52  template<euclidean_pattern C> requires
53  (dynamic_pattern<C> or descriptor<C>) and (dimension_of_v<C> != 0)
55 #else
56  template<typename C>
57  struct uniform_static_vector_space_descriptor_query<C, std::enable_if_t<euclidean_pattern<C> and
58  (dynamic_pattern<C> or descriptor<C>) and (dimension_of_v<C> != 0)>>
59 #endif
60  : std::true_type { using uniform_type = coordinates::Dimensions<1>; };
61 
62 
63 #ifdef __cpp_concepts
64  template<typename C> requires (dimension_of_v<C> == 1)
66 #else
67  template<typename C>
68  struct uniform_static_vector_space_descriptor_query<C, std::enable_if_t<dimension_of_v<C> == 1>>
69 #endif
71 
72 
73 #ifdef __cpp_concepts
74  template<descriptor C, fixed_pattern...Cs> requires (dimension_of_v<C> == 1) and
75  (sizeof...(Cs) > 0) and compares_with<C, typename uniform_static_vector_space_descriptor_query<std::tuple<Cs...>>::uniform_type>
76  struct uniform_static_vector_space_descriptor_query<std::tuple<C, Cs...>>
77 #else
78  template<typename C, typename...Cs>
79  struct uniform_static_vector_space_descriptor_query<std::tuple<C, Cs...>, std::enable_if_t<
80  descriptor<C> and (... and fixed_pattern<Cs>) and (dimension_of_v<C> == 1) and
81  (sizeof...(Cs) > 0) and compares_with<C, typename uniform_static_vector_space_descriptor_query<std::tuple<Cs...>>::uniform_type>>>
82 #endif
83  : std::true_type { using uniform_type = C; };
84 
85 } // namespace OpenKalman::coordinates::internal
86 
87 #endif //OPENKALMAN_UNIFORM_FIXED_VECTOR_SPACE_DESCRIPTOR_QUERY_HPP
Definition for coordinates::euclidean_pattern.
constexpr bool compares_with
Specifies that a set of coordinates::pattern objects may be equivalent based on what is known at comp...
Definition: compares_with.hpp:103
Definition: get_component_start_indices.hpp:29
Definition for coordinates::dynamic_pattern.
Definition for compares_with.
Definition: tuple_reverse.hpp:103
Definition for coordinates::fixed_pattern.
Definition for coordinates::descriptor.
constexpr bool descriptor
T is an atomic (non-separable or non-composite) grouping of coordinates::pattern objects.
Definition: descriptor.hpp:30
A structure representing the dimensions associated with of a particular index.
Definition: Dimensions.hpp:42
constexpr bool fixed_pattern
A coordinates::pattern for which the size is fixed at compile time.
Definition: fixed_pattern.hpp:47
Definition: uniform_static_vector_space_descriptor_query.hpp:36
Definition for coordinates::dimension_of.