OpenKalman
stat_dimension_of.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_COORDINATES_STAT_DIMENSION_OF_HPP
17 #define OPENKALMAN_COORDINATES_STAT_DIMENSION_OF_HPP
18 
19 #include <type_traits>
23 
25 {
31 #ifdef __cpp_concepts
32  template<pattern T>
33  struct stat_dimension_of : std::integral_constant<std::size_t, dynamic_size> {};
34 #else
35  template<typename T, typename = void>
36  struct stat_dimension_of {};
37 #endif
38 
39 
40 #ifndef __cpp_concepts
41  template<typename T>
42  struct stat_dimension_of<T, std::enable_if_t<not values::fixed<decltype(get_stat_dimension(std::declval<std::decay_t<T>>()))>>>
43  : std::integral_constant<std::size_t, dynamic_size> {};
44 #endif
45 
46 
47 #ifdef __cpp_concepts
48  template<pattern T> requires values::fixed<decltype(get_stat_dimension(std::declval<std::decay_t<T>>()))>
50 #else
51  template<typename T>
52  struct stat_dimension_of<T, std::enable_if_t<values::fixed<decltype(get_stat_dimension(std::declval<std::decay_t<T>>()))>>>
53 #endif
54  : std::integral_constant<std::size_t, values::to_number(get_stat_dimension(T{}))> {};
55 
56 
60  template<typename T>
62 
63 
64 } // namespace OpenKalman::coordinates
65 
66 #endif //OPENKALMAN_COORDINATES_STAT_DIMENSION_OF_HPP
Definition for values::to_number.
constexpr auto stat_dimension_of_v
Helper template for coordinates::stat_dimension_of.
Definition: stat_dimension_of.hpp:61
Definition: tuple_reverse.hpp:103
constexpr auto to_number(Arg arg)
Convert any values::value to a values::number.
Definition: to_number.hpp:34
Definition: compares_with.hpp:28
The dimension size of a set of coordinates::pattern if it is transformed into Euclidean space...
Definition: stat_dimension_of.hpp:36
constexpr auto get_stat_dimension(const Arg &arg)
Get the vector dimension of coordinates::pattern Arg when transformed into statistical space...
Definition: get_stat_dimension.hpp:53
Definition for coordinates::get_stat_dimension.
Definition for ::fixed.
constexpr bool fixed
T is a values::value that is determinable at compile time.
Definition: fixed.hpp:60