OpenKalman
not_more_fixed_than.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 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_NOT_MORE_FIXED_THAN_HPP
18 #define OPENKALMAN_NOT_MORE_FIXED_THAN_HPP
19 
20 
21 namespace OpenKalman::internal
22 {
23 #if not defined(__cpp_concepts) or __cpp_generic_lambdas < 201707L
24  namespace detail
25  {
26  template<typename T, typename Descriptors, std::size_t...Ix>
27  static constexpr bool not_more_fixed_than_impl(std::index_sequence<Ix...>)
28  {
29  return (... and (dynamic_dimension<T, Ix> or fixed_pattern<std::tuple_element_t<Ix, Descriptors>>));
30  }
31  } // namespace detail
32 #endif
33 
34 
38  template<typename T, typename Descriptors>
39 #if defined(__cpp_concepts) and __cpp_generic_lambdas >= 201707L
40  concept not_more_fixed_than =
41  indexible<T> and pattern_collection<Descriptors> and
42  (not pattern_tuple<Descriptors> or
43  []<std::size_t...Ix>(std::index_sequence<Ix...>)
44  { return (... and (dynamic_dimension<T, Ix> or fixed_pattern<std::tuple_element_t<Ix, Descriptors>>)); }
45  (std::make_index_sequence<std::tuple_size_v<Descriptors>>{}));
46 #else
47  constexpr bool not_more_fixed_than =
48  indexible<T> and pattern_collection<Descriptors> and
49  (not pattern_tuple<Descriptors> or
50  detail::not_more_fixed_than_impl<T, Descriptors>(std::make_index_sequence<std::tuple_size_v<Descriptors>>{}));
51 #endif
52 
53 } // namespace OpenKalman::internal
54 
55 #endif //OPENKALMAN_NOT_MORE_FIXED_THAN_HPP
constexpr bool not_more_fixed_than
indexible T&#39;s vector space descriptors are not more fixed than the specified vectors_space_descriptor...
Definition: not_more_fixed_than.hpp:47
Definition: basics.hpp:48