OpenKalman
fixed_pattern_collection.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) 2024-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_COORDINATE::FIXED_PATTERN_COLLECTION_HPP
17 #define OPENKALMAN_COORDINATE
18 
19 #ifdef __cpp_lib_ranges
20 #include <ranges>
21 #else
23 #endif
25 #include "pattern_collection.hpp"
26 #include "fixed_pattern.hpp"
27 #include "fixed_pattern_tuple.hpp"
28 
29 
31 {
32 #ifndef __cpp_lib_ranges
33  namespace detail
34  {
35  template<typename T, typename = void>
36  struct is_fixed_descriptor_range : std::false_type {};
37 
38  template<typename T>
39  struct is_fixed_descriptor_range<T, std::enable_if_t<fixed_pattern<ranges::range_value_t<T>>>>
40  : std::true_type {};
41  } // namespace detail
42 #endif
43 
44 
49  template<typename T>
50 #if defined(__cpp_lib_ranges) and defined(__cpp_lib_remove_cvref)
51  concept fixed_pattern_collection = pattern_collection<T> and
52  (fixed_pattern_tuple<T> or fixed_pattern<std::ranges::range_value_t<std::decay_t<T>>>);
53 #else
54  constexpr bool fixed_pattern_collection = collections::collection<T> and
55  (fixed_pattern_tuple<T> or detail::is_fixed_descriptor_range<T>::value);
56 #endif
57 
58 
59 } // namespace OpenKalman::coordinates
60 
61 #endif //OPENKALMAN_COORDINATE
Definition for pattern_collection.
Definition for collections::collection.
Definition: tuple_reverse.hpp:103
Definition for coordinates::fixed_pattern.
Definition: compares_with.hpp:28
Definitions implementing features of the c++ ranges library for compatibility.
Definition: fixed_pattern_collection.hpp:36
constexpr bool fixed_pattern
A coordinates::pattern for which the size is fixed at compile time.
Definition: fixed_pattern.hpp:47
Definition for coordinates::fixed_pattern_tuple.
constexpr bool fixed_pattern_collection
An object describing a collection of /ref coordinates::pattern objects.
Definition: fixed_pattern_collection.hpp:54