OpenKalman
triangle_type_of.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-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_TRIANGLE_TYPE_OF_HPP
17 #define OPENKALMAN_TRIANGLE_TYPE_OF_HPP
18 
24 
25 namespace OpenKalman
26 {
27  namespace detail
28  {
29 #ifdef __cpp_concepts
30  template<typename T>
31 #else
32  template<typename T, typename = void>
33 #endif
35  : std::integral_constant<triangle_type, zero<T> or one_dimensional<T, 2> ? triangle_type::diagonal : triangle_type::none> {};
36 
37 
38 #ifdef __cpp_concepts
39  template<indexible T> requires
40  requires { interface::object_traits<std::remove_cvref_t<T>>::triangle_type_value; }
41  struct triangle_type_of_impl<T>
42 #else
43  template<typename T>
44  struct triangle_type_of_impl<T, std::void_t<decltype(interface::object_traits<stdex::remove_cvref_t<T>>::triangle_type_value)>>
45 #endif
46  : std::integral_constant<
47  triangle_type, zero<T> or one_dimensional<T, 2> ?
48  triangle_type::diagonal :
49  interface::object_traits<stdex::remove_cvref_t<T>>::triangle_type_value>
50  {
51  static_assert(interface::object_traits<stdex::remove_cvref_t<T>>::triangle_type_value != triangle_type::any,
52  "triangle_type_value interface member cannot be triangle_type::any");
53  };
54  }
55 
56 
65  template<typename T>
67 
68 
72  template<typename T>
74 
75 }
76 
77 #endif
Enumerations relating to linear algebra.
Lower, upper, or diagonal matrix.
The root namespace for OpenKalman.
Definition: basics.hpp:34
Forward declaration of object_traits, which must be defined for all objects used in OpenKalman...
Definition: object_traits.hpp:38
constexpr auto triangle_type_of_v
Helper template for triangle_type_of.
Definition: triangle_type_of.hpp:73
Definition: triangle_type_of.hpp:34
The triangle_type associated with an indexible object.
Definition: triangle_type_of.hpp:66
Definition for one_dimensional.
Definition for zero.