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 "coordinates/coordinates.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  -> coordinates::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  static constexpr auto
94  nested_object = [](std::convertible_to<const T&> auto&& t)
95  -> indexible decltype(auto) { return std::forward<decltype(t)>(t); };
96 
97 
104  template<applicability b>
105  static constexpr bool
106  is_square = false;
107 
108 
113  static constexpr bool
114  is_triangular_adapter = false;
115 
116 
124  static constexpr bool
125  is_hermitian = false;
126 
127 
135  static constexpr HermitianAdapterType
136  hermitian_adapter_type = HermitianAdapterType::any;
137 
138 #endif // DOXYGEN_SHOULD_SKIP_THIS
139  };
140 
141 }
142 
143 
144 #endif
constexpr auto get_mdspan(T &t)
Get the coordinates::pattern_collection associated with indexible object T.
Definition: get_mdspan.hpp:35
Definition: basics.hpp:41
triangle_type
The type of a triangular matrix.
Definition: enumerations.hpp:26
constexpr bool indexible
T is a multidimensional array type.
Definition: indexible.hpp:32
decltype(auto) constexpr get_pattern_collection(T &&t)
Get the coordinates::pattern_collection associated with indexible object T.
Definition: get_pattern_collection.hpp:59
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
constexpr bool pattern_collection
An object describing a collection of /ref pattern objects.
Definition: pattern_collection.hpp:65
decltype(auto) constexpr nested_object(Arg &&arg)
Retrieve a nested object of Arg, if it exists.
Definition: nested_object.hpp:35