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-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_TRIANGLE_TYPE_OF_HPP
17 #define OPENKALMAN_TRIANGLE_TYPE_OF_HPP
18 
19 
20 namespace OpenKalman
21 {
28  template<typename T, typename...Ts>
30  : std::integral_constant<TriangleType,
31  (triangular_matrix<T, TriangleType::diagonal> and ... and triangular_matrix<Ts, TriangleType::diagonal>) ? TriangleType::diagonal :
32  (triangular_matrix<T, TriangleType::lower> and ... and triangular_matrix<Ts, TriangleType::lower>) ? TriangleType::lower :
33  (triangular_matrix<T, TriangleType::upper> and ... and triangular_matrix<Ts, TriangleType::upper>) ? TriangleType::upper :
34  TriangleType::any> {};
35 
36 
40  template<typename T, typename...Ts>
41  constexpr auto triangle_type_of_v = triangle_type_of<T, Ts...>::value;
42 
43 
44 } // namespace OpenKalman
45 
46 #endif //OPENKALMAN_TRIANGLE_TYPE_OF_HPP
constexpr bool value
T is numerical value or is reducible to a numerical value.
Definition: value.hpp:31
The root namespace for OpenKalman.
Definition: basics.hpp:34
The common TriangleType associated with a set of triangular matrices.
Definition: triangle_type_of.hpp:29
constexpr auto triangle_type_of_v
The TriangleType associated with a triangular_matrix.
Definition: triangle_type_of.hpp:41