OpenKalman
dynamic_dimension.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_DYNAMIC_DIMENSION_HPP
17 #define OPENKALMAN_DYNAMIC_DIMENSION_HPP
18 
20 
21 namespace OpenKalman
22 {
23 #ifndef __cpp_concepts
24  namespace detail
25  {
26  template<typename T, std::size_t N, typename = void>
27  struct is_dynamic_dimension : std::false_type {};
28 
29  template<typename T, std::size_t N>
30  struct is_dynamic_dimension<T, N, std::enable_if_t<indexible<T> and index_dimension_of<T, N>::value == stdex::dynamic_extent>>
31  : std::true_type {};
32  }
33 #endif
34 
35 
40  template<typename T, std::size_t N>
41 #ifdef __cpp_concepts
42  concept dynamic_dimension = indexible<T> and (index_dimension_of_v<T, N> == std::dynamic_extent);
43 #else
44  constexpr bool dynamic_dimension = detail::is_dynamic_dimension<T, N>::value;
45 #endif
46 
47 
48 }
49 
50 #endif
Definition: dynamic_dimension.hpp:27
The root namespace for OpenKalman.
Definition: basics.hpp:34
Definition for index_dimension_of.
constexpr bool dynamic_dimension
Specifies that T&#39;s index N has a dimension defined at run time.
Definition: dynamic_dimension.hpp:44