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-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_COMPLEX_HPP
17 #define OPENKALMAN_VALUES_COMPLEX_HPP
18 
19 #include "basics/basics.hpp"
22 #include "value.hpp"
23 
24 namespace OpenKalman::values
25 {
26 #ifndef __cpp_concepts
27  namespace detail
28  {
29  template<typename T, typename = void>
30  struct complex_impl : std::false_type {};
31 
32 
33  template<typename T>
34  struct complex_impl<T, std::enable_if_t<interface::number_traits<typename values::value_type_of<T>::type>::is_complex>>
35  : std::true_type {};
36  }
37 #endif
38 
39 
43  template<typename T>
44 #ifdef __cpp_concepts
45  concept complex = value<T> and interface::number_traits<typename value_type_of<T>::type>::is_complex;
46 #else
47  constexpr bool complex = value<T> and detail::complex_impl<std::decay_t<T>>::value;
48 #endif
49 
50 
51 }
52 
53 #endif
constexpr bool complex
T is a value that reduces to std::complex or a custom complex type.
Definition: complex.hpp:47
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45
Definition for value:value_type_of and value:value_type_of_t.
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.
Definition for values::value.