OpenKalman
complex.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) 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_VALUE_COMPLEX_HPP
17 #define OPENKALMAN_VALUE_COMPLEX_HPP
18 
19 #include <type_traits>
22 
23 namespace OpenKalman::values
24 {
25 #ifndef __cpp_concepts
26  namespace detail
27  {
28  template<typename T, typename = void>
29  struct complex_impl : std::false_type {};
30 
31 
32  template<typename T>
33  struct complex_impl<T, std::enable_if_t<interface::number_traits<values::number_type_of_t<T>>::is_complex>>
34  : std::true_type {};
35  }
36 #endif
37 
38 
42  template<typename T>
43 #ifdef __cpp_concepts
44  concept complex = values::value<T> and interface::number_traits<values::number_type_of_t<T>>::is_complex;
45 #else
47 #endif
48 
49 
50 } // namespace OpenKalman::values
51 
52 #endif //OPENKALMAN_VALUE_COMPLEX_HPP
constexpr bool complex
T is a values::value that reduces to std::complex or a custom complex type.
Definition: complex.hpp:46
Definition: tuple_reverse.hpp:103
constexpr bool value
T is numerical value or is reducible to a numerical value.
Definition: value.hpp:31
Definition for value:number_type_of_t.
Definition for values::abs.
Definition: constant_coefficient.hpp:25
Definition: number_traits.hpp:36
Traits for arithmetic and complex scalar types.