OpenKalman
get_descriptor_stat_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) 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 
17 #ifndef OPENKALMAN_GET_DESCRIPTOR_EUCLIDEAN_SIZE_HPP
18 #define OPENKALMAN_GET_DESCRIPTOR_EUCLIDEAN_SIZE_HPP
19 
21 #include "linear-algebra/coordinates/interfaces/coordinate_descriptor_traits.hpp"
23 
25 {
31 #ifdef __cpp_concepts
32  template<descriptor Arg>
33  constexpr values::index decltype(auto)
34 #else
35  template<typename Arg, std::enable_if_t<descriptor<Arg>, int> = 0>
36  constexpr decltype(auto)
37 #endif
38  get_descriptor_stat_dimension(Arg&& arg)
39  {
40  if constexpr (interface::coordinate_descriptor_traits<std::decay_t<Arg>>::is_specialized)
41  {
42  return interface::coordinate_descriptor_traits<std::decay_t<Arg>>::stat_dimension(std::forward<Arg>(arg));
43  }
44  else
45  {
46  static_assert(values::index<Arg>);
47  return std::forward<Arg>(arg);
48  }
49  }
50 
51 
52 } // namespace OpenKalman::coordinates::internal
53 
54 
55 #endif //OPENKALMAN_GET_DESCRIPTOR_EUCLIDEAN_SIZE_HPP
Definition for values::index.
Definition: get_component_start_indices.hpp:29
Definition for coordinates::descriptor.
constexpr bool index
T is an index value.
Definition: index.hpp:56