OpenKalman
euclidean_pattern.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_EUCLIDEAN_VECTOR_SPACE_DESCRIPTOR_HPP
17 #define OPENKALMAN_EUCLIDEAN_VECTOR_SPACE_DESCRIPTOR_HPP
18 
19 #include <type_traits>
24 
26 {
27 #ifndef __cpp_concepts
28  namespace detail
29  {
30  template<typename T, typename = void>
31  struct euclidean_pattern_impl : std::false_type {};
32 
33  template<typename T>
34  struct euclidean_pattern_impl<T, std::enable_if_t<values::fixed<decltype(coordinates::get_is_euclidean(std::declval<T>()))>>>
35  : std::bool_constant<values::fixed_number_of_v<decltype(coordinates::get_is_euclidean(std::declval<T>()))>> {};
36  }
37 #endif
38 
39 
43 #ifdef __cpp_concepts
44  template<typename T>
45  concept euclidean_pattern = pattern<T> and
46  (values::fixed_number_of<decltype(coordinates::get_is_euclidean(std::declval<T>()))>::value);
47 #else
48  template<typename T>
49  constexpr bool euclidean_pattern = detail::euclidean_pattern_impl<T>::value;
50 #endif
51 
52 } // namespace OpenKalman::coordinates
53 
54 #endif //OPENKALMAN_EUCLIDEAN_VECTOR_SPACE_DESCRIPTOR_HPP
Definition for values::fixed_number_of.
Definition: tuple_reverse.hpp:103
constexpr bool value
T is numerical value or is reducible to a numerical value.
Definition: value.hpp:31
Definition for coordinates::pattern.
Definition: compares_with.hpp:28
The fixed number associated with a values::fixed.
Definition: fixed_number_of.hpp:45
Definition for get_is_euclidean.
Definition for ::fixed.
constexpr bool euclidean_pattern
A coordinates::pattern for a normal Euclidean vector.
Definition: euclidean_pattern.hpp:49