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 
20 
21 namespace OpenKalman
22 {
23 #ifndef __cpp_concepts
24  namespace detail
25  {
26  template<typename T, HermitianAdapterType t, typename = void>
27  struct hermitian_adapter_impl : std::false_type {};
28 
29  template<typename T, HermitianAdapterType t>
30  struct hermitian_adapter_impl<T, t, std::enable_if_t<
31  (t == HermitianAdapterType::any ?
32  interface::object_traits<stdex::remove_cvref_t<T>>::hermitian_adapter_type == HermitianAdapterType::lower or
33  interface::object_traits<stdex::remove_cvref_t<T>>::hermitian_adapter_type == HermitianAdapterType::upper :
34  interface::object_traits<stdex::remove_cvref_t<T>>::hermitian_adapter_type == t)>> : std::true_type {};
35  };
36 #endif
37 
38 
47  template<typename T, HermitianAdapterType t = HermitianAdapterType::any>
48 #ifdef __cpp_concepts
49  concept hermitian_adapter = hermitian_matrix<T> and
51  interface::object_traits<stdex::remove_cvref_t<T>>::hermitian_adapter_type == HermitianAdapterType::lower or
52  interface::object_traits<stdex::remove_cvref_t<T>>::hermitian_adapter_type == HermitianAdapterType::upper :
53  interface::object_traits<stdex::remove_cvref_t<T>>::hermitian_adapter_type == t);
54 #else
55  constexpr bool hermitian_adapter = hermitian_matrix<T> and detail::hermitian_adapter_impl<std::decay_t<T>, t>::value;
56 #endif
57 
58 
59 }
60 
61 #endif
constexpr bool hermitian_adapter
Specifies that a type is a hermitian matrix adapter of a particular type.
Definition: hermitian_adapter.hpp:55
A lower-left triangular matrix.
Definition: hermitian_adapter.hpp:27
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45
Enumerations relating to linear algebra.
Lower, upper, or diagonal matrix.
The root namespace for OpenKalman.
Definition: basics.hpp:34
Definition: object_traits.hpp:38
An upper-right triangular matrix.