OpenKalman
IdentityTransformation.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) 2020-2021 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_IDENTITYTRANSFORMATION_HPP
17 #define OPENKALMAN_IDENTITYTRANSFORMATION_HPP
18 
19 
20 namespace OpenKalman
21 {
22  namespace oin = OpenKalman::internal;
23 
24 
29  struct IdentityTransformation;
30 
31 
32  namespace internal
33  {
34 #ifdef __cpp_concepts
35  template<std::size_t order> requires (order <= 1)
36  struct is_linearized_function<IdentityTransformation, order> : std::true_type {};
37 #else
38  template<std::size_t order>
39  struct is_linearized_function<IdentityTransformation, order, std::enable_if_t<order <= 1>> : std::true_type {};
40 #endif
41  }
42 
43 
45  {
47 #ifdef __cpp_concepts
48  template<transformation_input In, perturbation<vector_space_descriptor_of_t<In, 0>> ... Perturbations>
49 #else
50  template<typename In, typename ... Perturbations, std::enable_if_t<transformation_input<In> and
51  (perturbation<Perturbations, vector_space_descriptor_of_t<In, 0>> and ...), int> = 0>
52 #endif
53  auto operator()(In&& in, Perturbations&& ... ps) const
54  {
55  return make_self_contained((std::forward<In>(in) + ... + std::forward<Perturbations>(ps)));
56  }
57 
58 
60 #ifdef __cpp_concepts
61  template<transformation_input In, perturbation<vector_space_descriptor_of_t<In, 0>> ... Perturbations>
62 #else
63  template<typename In, typename ... Perturbations, std::enable_if_t<transformation_input<In> and
64  (perturbation<Perturbations, vector_space_descriptor_of_t<In, 0>> and ...), int> = 0>
65 #endif
66  auto jacobian(In&& in, Perturbations&&...ps) const
67  {
68  return std::make_tuple(
71  }
72 
73  };
74 
75 }
76 
77 
78 #endif //OPENKALMAN_IDENTITYTRANSFORMATION_HPP
Definition: tuple_reverse.hpp:103
The root namespace for OpenKalman.
Definition: basics.hpp:34
auto operator()(In &&in, Perturbations &&... ps) const
Applies the tests.
Definition: IdentityTransformation.hpp:53
constexpr auto make_identity_matrix_like(Descriptors &&descriptors)
Make an identity_matrix with a particular set of coordinates::pattern objects.
Definition: make_identity_matrix_like.hpp:35
typename vector_space_descriptor_of< T, N >::type vector_space_descriptor_of_t
helper template for vector_space_descriptor_of.
Definition: vector_space_descriptor_of.hpp:56
constexpr auto make_zero(Descriptors &&descriptors)
Make a zero associated with a particular library.
Definition: make_zero.hpp:36
auto jacobian(In &&in, Perturbations &&...ps) const
Returns a tuple of the Jacobians for the input and each perturbation term.
Definition: IdentityTransformation.hpp:66
Definition: IdentityTransformation.hpp:44
Definition: basics.hpp:48