OpenKalman
get_descriptor_is_euclidean.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_IS_EUCLIDEAN_HPP
18 #define OPENKALMAN_GET_DESCRIPTOR_IS_EUCLIDEAN_HPP
19 
20 #include "values/values.hpp"
21 #include "coordinates/interfaces/coordinate_descriptor_traits.hpp"
23 
25 {
30 #ifdef __cpp_concepts
31  template<descriptor Arg>
32  constexpr OpenKalman::internal::boolean_testable decltype(auto)
33 #else
34  template<typename Arg, std::enable_if_t<descriptor<Arg>, int> = 0>
35  constexpr auto
36 #endif
37  get_descriptor_is_euclidean(const Arg& arg)
38  {
39  if constexpr (values::index<Arg>)
40  {
41  return std::true_type{};
42  }
43  else
44  {
45  using U = std::decay_t<stdex::unwrap_reference_t<Arg>>;
46  using Traits = interface::coordinate_descriptor_traits<U>;
47  if constexpr (std::is_same_v<U, Arg>) return Traits::is_euclidean(arg);
48  else return Traits::is_euclidean(arg.get());
49  }
50  }
51 
52 
53 }
54 
55 
56 #endif
Definition: get_descriptor_dimension.hpp:25
Header file for code relating to values (e.g., scalars and indices)
Definition for coordinates::descriptor.