OpenKalman
best_vector_space_descriptor.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-2023 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_BEST_VECTOR_SPACE_DESCRIPTOR_HPP
18 #define OPENKALMAN_BEST_VECTOR_SPACE_DESCRIPTOR_HPP
19 
21 
22 namespace OpenKalman::internal
23 {
27 #ifdef __cpp_concepts
28  template<coordinates::pattern D, coordinates::pattern...Ds> requires (... and compares_with<D, Ds, equal_to<>, Applicability::permitted>)
29 #else
30  template<typename D, typename...Ds, std::enable_if_t<(... and compares_with<D, Ds, equal_to<>, Applicability::permitted>), int> = 0>
31 #endif
32  constexpr decltype(auto) best_vector_space_descriptor(D&& d, Ds&&...ds)
33  {
34  if constexpr (sizeof...(Ds) == 0) return std::forward<D>(d);
35  else if constexpr (fixed_pattern<D>) return std::forward<D>(d);
36  else return best_vector_space_descriptor(std::forward<Ds>(ds)...);
37  }
38 
39 
40 } // namespace OpenKalman::internal
41 
42 #endif //OPENKALMAN_BEST_VECTOR_SPACE_DESCRIPTOR_HPP
Definition for compares_with.
decltype(auto) constexpr best_vector_space_descriptor(D &&d, Ds &&...ds)
Given one or more /ref coordinates::pattern objects, return the "best" one (i.e., the one that is sta...
Definition: best_vector_space_descriptor.hpp:32
The concept, trait, or restraint is permitted, but whether it applies is not necessarily known at com...
Definition: basics.hpp:48