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 
21 #include "../interfaces/object_traits.hpp"
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> ? 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<triangle_type, interface::object_traits<stdex::remove_cvref_t<T>>::triangle_type_value>
47  {
48  static_assert(interface::object_traits<stdex::remove_cvref_t<T>>::triangle_type_value != triangle_type::any,
49  "triangle_type_value interface member cannot be triangle_type::any");
50  };
51  }
52 
53 
62  template<typename T>
64 
65 
69  template<typename T>
71 
72 }
73 
74 #endif
Enumerations relating to linear algebra.
Lower, upper, or diagonal matrix.
The root namespace for OpenKalman.
Definition: basics.hpp:34
Definition: object_traits.hpp:38
constexpr auto triangle_type_of_v
Helper template for triangle_type_of.
Definition: triangle_type_of.hpp:70
Definition: triangle_type_of.hpp:34
The triangle_type associated with an indexible object.
Definition: triangle_type_of.hpp:63
Definition for one_dimensional.
Definition for zero.