OpenKalman
fixed_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_COORDINATE_FIXED_PATTERN_HPP
17 #define OPENKALMAN_COORDINATE_FIXED_PATTERN_HPP
18 
19 #include <type_traits>
22 #include "pattern.hpp"
24 
26 {
27 #ifndef __cpp_concepts
28  namespace detail
29  {
30  template<typename T, typename = void>
31  struct fixed_pattern_impl : std::false_type {};
32 
33  template<typename T>
34  struct fixed_pattern_impl<T, std::enable_if_t<dimension_of<T>::value != dynamic_size>> : std::true_type {};
35  }
36 #endif
37 
38 
42  template<typename T>
43 #ifdef __cpp_concepts
44  concept fixed_pattern = std::default_initializable<std::decay_t<T>> and
45  pattern<T> and (dimension_of_v<T> != dynamic_size);
46 #else
47  constexpr bool fixed_pattern = std::is_default_constructible<std::decay_t<T>>::value and
49 #endif
50 
51 
52 } // namespace OpenKalman::coordinates
53 
54 #endif //OPENKALMAN_COORDINATE_FIXED_PATTERN_HPP
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
Definition for ::fixed.
constexpr bool fixed_pattern
A coordinates::pattern for which the size is fixed at compile time.
Definition: fixed_pattern.hpp:47
constexpr std::size_t dynamic_size
A constant indicating that a size or index is dynamic.
Definition: global-definitions.hpp:33
Global definitions for OpenKalman.
Definition for coordinates::dimension_of.