OpenKalman
to_covariance_nestable.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 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 
17 #ifndef OPENKALMAN_TO_COVARIANCE_NESTABLE_HPP
18 #define OPENKALMAN_TO_COVARIANCE_NESTABLE_HPP
19 
20 namespace OpenKalman::internal
21 {
28 #ifdef __cpp_concepts
29  template<covariance_nestable T, typename Arg> requires
30  (covariance_nestable<Arg> or (typed_matrix_nestable<Arg> and (square_shaped<Arg> or vector<Arg>))) and
31  (index_dimension_of_v<Arg, 0> == index_dimension_of_v<T, 0>) and
32  (not zero<T> or zero<Arg>) and (not identity_matrix<T> or identity_matrix<Arg>) and
33  (not diagonal_matrix<T> or diagonal_matrix<Arg> or vector<Arg>)
34 #else
35  template<typename T, typename Arg, typename = std::enable_if_t<
36  (not std::is_same_v<T, Arg>) and covariance_nestable<T> and
37  (covariance_nestable<Arg> or (typed_matrix_nestable<Arg> and (square_shaped<Arg> or vector<Arg>))) and
39  (not zero<T> or zero<Arg>) and (not identity_matrix<T> or identity_matrix<Arg>) and
40  (not diagonal_matrix<T> or diagonal_matrix<Arg> or vector<Arg>)>>
41 #endif
42  constexpr decltype(auto)
43  to_covariance_nestable(Arg&&);
44 
45 
54 #ifdef __cpp_concepts
55  template<covariance_nestable T, typename Arg> requires
56  (covariance<Arg> or (typed_matrix<Arg> and (square_shaped<Arg> or vector<Arg>))) and
57  (index_dimension_of_v<Arg, 0> == index_dimension_of_v<T, 0>) and
58  (not zero<T> or zero<Arg>) and (not identity_matrix<T> or identity_matrix<Arg>) and
59  (not diagonal_matrix<T> or diagonal_matrix<Arg> or vector<Arg>)
60 #else
61  template<typename T, typename Arg, typename = void, typename = std::enable_if_t<
62  (not std::is_same_v<T, Arg>) and covariance_nestable<T> and (not std::is_void_v<Arg>) and
63  (covariance<Arg> or (typed_matrix<Arg> and (square_shaped<Arg> or vector<Arg>))) and
65  (not zero<T> or zero<Arg>) and (not identity_matrix<T> or identity_matrix<Arg>) and
66  (not diagonal_matrix<T> or diagonal_matrix<Arg> or vector<Arg>)>>
67 #endif
68  constexpr decltype(auto)
69  to_covariance_nestable(Arg&&);
70 
71 
77 #ifdef __cpp_concepts
78  template<typename Arg>
79  requires covariance_nestable<Arg> or (typed_matrix_nestable<Arg> and (square_shaped<Arg> or vector<Arg>))
80 #else
81  template<typename Arg, typename = std::enable_if_t<covariance_nestable<Arg> or
82  (typed_matrix_nestable<Arg> and (square_shaped<Arg> or vector<Arg>))>>
83 #endif
84  constexpr decltype(auto)
85  to_covariance_nestable(Arg&&);
86 
87 
93 #ifdef __cpp_concepts
94  template<typename Arg> requires covariance<Arg> or
95  (typed_matrix<Arg> and (square_shaped<Arg> or vector<Arg>))
96 #else
97  template<typename Arg, typename = void, typename = std::enable_if_t<covariance<Arg> or
98  (typed_matrix<Arg> and (square_shaped<Arg> or vector<Arg>))>>
99 #endif
100  constexpr decltype(auto)
101  to_covariance_nestable(Arg&&);
102 
103 
104 } // namespace OpenKalman::internal
105 
106 #endif //OPENKALMAN_TO_COVARIANCE_NESTABLE_HPP
constexpr bool value
T is numerical value or is reducible to a numerical value.
Definition: value.hpp:31
Definition: basics.hpp:48