OpenKalman
number.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-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_VALUES_NUMBER_HPP
17 #define OPENKALMAN_VALUES_NUMBER_HPP
18 
19 #include "basics/basics.hpp"
21 
22 namespace OpenKalman::values
23 {
29  template<typename T>
30 #ifdef __cpp_concepts
31  concept number =
32  interface::number_traits<std::decay_t<T>>::is_specialized and
33  std::regular<T> and
34  requires(const std::remove_reference_t<T>& t) {
35  { t + t } -> std::convertible_to<const std::decay_t<T>&>;
36  { t - t } -> std::convertible_to<const std::decay_t<T>&>;
37  { t * t } -> std::convertible_to<const std::decay_t<T>&>;
38  { t / t } -> std::convertible_to<const std::decay_t<T>&>;
39  };
40 #else
41  constexpr bool number =
43 #endif
44 
45 
46 }
47 
48 
49 #endif
constexpr bool number
T is a numerical field type.
Definition: number.hpp:41
Definition for values::abs.
Definition: fixed-constants.hpp:23
Basic definitions for OpenKalman as a whole.
Definition: number_traits.hpp:36
Traits for arithmetic and complex scalar types.