OpenKalman
hermitian_adapter.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) 2019-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 
16 #ifndef OPENKALMAN_HERMITIAN_ADAPTER_HPP
17 #define OPENKALMAN_HERMITIAN_ADAPTER_HPP
18 
19 
20 namespace OpenKalman
21 {
22 #ifndef __cpp_concepts
23  namespace detail
24  {
25  template<typename T, HermitianAdapterType t, typename = void>
26  struct hermitian_adapter_impl : std::false_type {};
27 
28  template<typename T, HermitianAdapterType t>
29  struct hermitian_adapter_impl<T, t, std::enable_if_t<
30  (t == HermitianAdapterType::any ?
31  interface::indexible_object_traits<std::decay_t<T>>::hermitian_adapter_type == HermitianAdapterType::lower or
32  interface::indexible_object_traits<std::decay_t<T>>::hermitian_adapter_type == HermitianAdapterType::upper :
33  interface::indexible_object_traits<std::decay_t<T>>::hermitian_adapter_type == t)>> : std::true_type {};
34  };
35 #endif
36 
37 
46  template<typename T, HermitianAdapterType t = HermitianAdapterType::any>
47 #ifdef __cpp_concepts
48  concept hermitian_adapter = hermitian_matrix<T, Applicability::permitted> and has_nested_object<T> and
50  interface::indexible_object_traits<std::decay_t<T>>::hermitian_adapter_type == HermitianAdapterType::lower or
51  interface::indexible_object_traits<std::decay_t<T>>::hermitian_adapter_type == HermitianAdapterType::upper :
52  interface::indexible_object_traits<std::decay_t<T>>::hermitian_adapter_type == t);
53 #else
54  constexpr bool hermitian_adapter = hermitian_matrix<T, Applicability::permitted> and has_nested_object<T> and
56 #endif
57 
58 
59 } // namespace OpenKalman
60 
61 #endif //OPENKALMAN_HERMITIAN_ADAPTER_HPP
Definition: indexible_object_traits.hpp:36
constexpr bool hermitian_adapter
Specifies that a type is a hermitian matrix adapter of a particular type.
Definition: hermitian_adapter.hpp:54
Lower, upper, or diagonal matrix.
Definition: hermitian_adapter.hpp:26
Definition: tuple_reverse.hpp:103
constexpr bool value
T is numerical value or is reducible to a numerical value.
Definition: value.hpp:31
An upper-right triangular matrix.
The root namespace for OpenKalman.
Definition: basics.hpp:34
A lower-left triangular matrix.