OpenKalman
object_traits.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_OBJECT_TRAITS_HPP
17 #define OPENKALMAN_OBJECT_TRAITS_HPP
18 
19 #ifdef DOXYGEN_SHOULD_SKIP_THIS
20 #include "patterns/patterns.hpp"
22 #endif
23 
24 namespace OpenKalman::interface
25 {
33 #ifdef __cpp_concepts
34  template<typename T>
35 #else
36  template<typename T, typename = void>
37 #endif
39  {
43  static const bool
44  is_specialized = false;
45 
46 
47 #ifdef DOXYGEN_SHOULD_SKIP_THIS
48 
52  static constexpr auto
53  get_mdspan = [](std::convertible_to<const T&> auto&& t) -> decltype(auto) { return std::mdspan{t}; };
54 
55 
60  static constexpr auto
61  get_pattern_collection = [](std::convertible_to<const T&> auto&&)
62  -> patterns::pattern_collection decltype(auto) { return std::tuple{}; };
63 
64 
71  static constexpr triangle_type
72  triangle_type_value = triangle_type::none;
73 
74 
83  static constexpr auto
84  get_constant = [](std::convertible_to<const T&> auto&&) -> values::value auto { return ...; };
85 
86 
93  template<applicability b>
94  static constexpr bool
95  is_square = false;
96 
97 
102  static constexpr bool
103  is_triangular_adapter = false;
104 
105 
113  static constexpr bool
114  is_hermitian = false;
115 
116 
124  static constexpr HermitianAdapterType
125  hermitian_adapter_type = HermitianAdapterType::any;
126 
127 #endif // DOXYGEN_SHOULD_SKIP_THIS
128  };
129 
130 }
131 
132 
133 #endif
constexpr bool pattern_collection
An object describing a sized collection of /ref sized_pattern objects.
Definition: pattern_collection.hpp:66
Definition: basics.hpp:41
triangle_type
The type of a triangular matrix.
Definition: enumerations.hpp:26
decltype(auto) constexpr get_pattern_collection(T &&t)
Get the patterns::pattern_collection associated with indexible object T.
Definition: get_pattern_collection.hpp:36
HermitianAdapterType
The type of a hermitian adapter, indicating which triangle of the nested matrix is used...
Definition: enumerations.hpp:79
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.
static const bool is_specialized
Identifies types for which object_traits is specialized.
Definition: object_traits.hpp:44
Definition: object_traits.hpp:38
decltype(auto) constexpr get_mdspan(T &&t)
Get the mdspan associated with indexible object T.
Definition: get_mdspan.hpp:35