OpenKalman
to_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) 2022-2024 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_TO_EUCLIDEAN_HPP
17 #define OPENKALMAN_TO_EUCLIDEAN_HPP
18 
24 
25 namespace OpenKalman
26 {
31 #ifdef __cpp_concepts
32  template<indexible Arg>
33  constexpr indexible decltype(auto)
34 #else
35  template<typename Arg, std::enable_if_t<indexible<Arg>, int> = 0>
36  constexpr decltype(auto)
37 #endif
38  to_euclidean(Arg&& arg)
39  {
40  if constexpr (coordinates::euclidean_pattern<vector_space_descriptor_of_t<Arg, 0>>)
41  {
42  return std::forward<Arg>(arg);
43  }
44  else if constexpr (interface::to_euclidean_defined_for<Arg, Arg&&>)
45  {
47  }
48  else
49  {
50  return ToEuclideanExpr {std::forward<Arg>(arg)};
51  }
52  }
53 
54 
55 } // namespace OpenKalman
56 
57 #endif //OPENKALMAN_TO_EUCLIDEAN_HPP
Definition for coordinates::euclidean_pattern.
Definition for vector_space_descriptor_of.
constexpr bool indexible
T is a generalized tensor type.
Definition: indexible.hpp:32
ToEuclideanExpr and related definitions.
The root namespace for OpenKalman.
Definition: basics.hpp:34
An interface to various routines from the linear algebra library associated with indexible object T...
Definition: library_interface.hpp:37
An expression that transforms vector space descriptors into Euclidean space for application of direct...
Definition: forward-class-declarations.hpp:384
decltype(auto) constexpr to_euclidean(Arg &&arg)
Project the vector space associated with index 0 to a Euclidean space for applying directional statis...
Definition: to_euclidean.hpp:38
typename vector_space_descriptor_of< T, N >::type vector_space_descriptor_of_t
helper template for vector_space_descriptor_of.
Definition: vector_space_descriptor_of.hpp:56
Definition for indexible.
Concepts for testing whether library_interface functions are defined for a particular object...