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<typename T>
33 #else
34  template<typename T, typename = void>
35 #endif
36  struct stat_dimension_of {};
37 
38 
39 #ifdef __cpp_concepts
40  template<pattern T> requires requires(T&& t) { {coordinates::get_stat_dimension(t)} -> values::index; }
41  struct stat_dimension_of<T>
42 #else
43  template<typename T>
44  struct stat_dimension_of<T, std::enable_if_t<values::index<decltype(coordinates::get_stat_dimension(std::declval<T>()))>>>
45 #endif
46  : std::conditional_t<
47  values::fixed<decltype(coordinates::get_stat_dimension(std::declval<T>()))>,
48  values::fixed_value_of<decltype(coordinates::get_stat_dimension(std::declval<T>()))>,
49  std::integral_constant<std::size_t, stdex::dynamic_extent>> {};
50 
51 
55  template<typename T>
57 
58 
59 }
60 
61 #endif
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:69
Definition for values::to_value_type.
The namespace for features relating to coordinates::pattern object.
Definition: compares_with.hpp:25
The dimension size of a set of coordinates::pattern if it is transformed into Euclidean space...
Definition: stat_dimension_of.hpp:36
constexpr auto stat_dimension_of_v
Helper template for coordinates::stat_dimension_of.
Definition: stat_dimension_of.hpp:56
Definition for coordinates::get_stat_dimension.
constexpr bool index
T is an index value.
Definition: index.hpp:62
Definition for ::fixed.