OpenKalman
euclidean_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_EUCLIDEAN_PATTERN_COLLECTION_HPP
17 #define OPENKALMAN_EUCLIDEAN_PATTERN_COLLECTION_HPP
18 
20 #include "euclidean_pattern.hpp"
21 
23 {
24 #if not defined(__cpp_concepts) or __cpp_generic_lambdas < 201707L
25  namespace detail
26  {
27  template<typename T, std::size_t...Ix>
28  constexpr bool is_euclidean_pattern_iter_impl(std::index_sequence<Ix...>)
29  {
30  return (... and euclidean_pattern<collections::collection_element_t<Ix, T>>);
31  }
32 
33 
34  template<typename T, typename = void>
35  struct is_euclidean_pattern_iter : std::false_type {};
36 
37  template<typename T>
38  struct is_euclidean_pattern_iter<T, std::enable_if_t<collections::uniformly_gettable<T>>>
39  : std::bool_constant<is_euclidean_pattern_iter_impl<T>(std::make_index_sequence<collections::size_of_v<T>>{})> {};
40 
41 
42  template<typename T, typename = void>
43  struct is_euclidean_descriptor_range : std::false_type {};
44 
45  template<typename T>
46  struct is_euclidean_descriptor_range<T, std::enable_if_t<euclidean_pattern<stdex::ranges::range_value_t<T>>>>
47  : std::true_type {};
48  }
49 #endif
50 
51 
55  template<typename T>
56 #if defined(__cpp_concepts) and __cpp_generic_lambdas >= 201707L
58  collections::collection<T> and
59  ( euclidean_pattern<stdex::ranges::range_value_t<T>> or
60  []<std::size_t...Ix>(std::index_sequence<Ix...>)
61  { return (... and euclidean_pattern<collections::collection_element_t<Ix, T>>); }
62  (std::make_index_sequence<collections::size_of_v<T>>{})
63  );
64 #else
65  constexpr bool euclidean_pattern_collection =
66  collections::collection<T> and
69 #endif
70 
71 
72 }
73 
74 #endif
Definition for coordinates::euclidean_pattern.
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45
The namespace for features relating to coordinates::pattern object.
Definition: compares_with.hpp:25
Inclusion file for collections.
constexpr bool euclidean_pattern_collection
An object describing a collection of /ref euclidean_pattern objects.
Definition: euclidean_pattern_collection.hpp:65
Definition: trait_backports.hpp:64
constexpr bool euclidean_pattern
A coordinates::pattern for a normal Euclidean vector.
Definition: euclidean_pattern.hpp:49