OpenKalman
compare.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 b 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 
16 #ifndef OPENKALMAN_COORDINATES_COMPARE_HPP
17 #define OPENKALMAN_COORDINATES_COMPARE_HPP
18 
22 
24 {
30 #ifdef __cpp_concepts
31  template<auto comp = &stdex::is_eq, pattern A, pattern B> requires
32  std::is_invocable_r_v<bool, decltype(comp), stdex::partial_ordering>
33  constexpr OpenKalman::internal::boolean_testable auto
34 #else
35  template<auto comp = &stdex::is_eq, typename A, typename B, std::enable_if_t<
36  pattern<A> and pattern<B> and
37  std::is_invocable_r_v<bool, decltype(comp), stdex::partial_ordering>, int> = 0>
38  constexpr auto
39 #endif
40  compare(const A& a, const B& b)
41  {
42  return values::operation(comp, compare_three_way(a, b));
43  }
44 
45 }
46 
47 #endif
constexpr auto compare(const A &a, const B &b)
Compare two coordinates::pattern objects lexicographically.
Definition: compare.hpp:40
Definition for coordinates::pattern.
The namespace for features relating to coordinates::pattern object.
Definition: compares_with.hpp:25
Inclusion file for collections.
Definition of coordinates::compare_three_way.
constexpr auto compare_three_way(A &&a, B &&b, const Comparison &c={})
Compare two coordinates::pattern objects lexicographically.
Definition: compare_three_way.hpp:142
constexpr auto operation(Operation &&op, Args &&...args)
A potentially constant-evaluated operation involving some number of values.
Definition: operation.hpp:98