OpenKalman
Map.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_EIGEN_TRAITS_MAP_HPP
17 #define OPENKALMAN_EIGEN_TRAITS_MAP_HPP
18 
19 #include <type_traits>
20 
21 
22 namespace OpenKalman::interface
23 {
24  template<typename PlainObjectType, int MapOptions, typename StrideType>
25  struct indexible_object_traits<Eigen::Map<PlainObjectType, MapOptions, StrideType>>
26  : Eigen3::indexible_object_traits_base<Eigen::Map<PlainObjectType, MapOptions, StrideType>>
27  {
28  private:
29 
30  using Xpr = Eigen::Map<PlainObjectType, MapOptions, StrideType>;
32 
33  public:
34 
35  template<typename Arg>
36  static decltype(auto) nested_object(Arg&& arg)
37  {
38  return *std::forward<Arg>(arg).data();
39  }
40 
41 
42  // get_constant() not defined
43 
44  // get_constant_diagonal() not defined
45 
46 
47  static constexpr Layout layout = std::is_same_v<StrideType, Eigen::Stride<0, 0>> ? layout_of_v<PlainObjectType> : Layout::stride;
48 
49  };
50 
51 } // namespace OpenKalman::interface
52 
53 #endif //OPENKALMAN_EIGEN_TRAITS_MAP_HPP
Definition: indexible_object_traits.hpp:36
Definition: basics.hpp:41
Trait object providing get and set routines.
Definition: eigen-forward-declarations.hpp:502
Definition: eigen-comma-initializers.hpp:20
A generalization of the above: a custom stride is specified for each index.
Layout
The layout format of a multidimensional array.
Definition: global-definitions.hpp:47
decltype(auto) constexpr nested_object(Arg &&arg)
Retrieve a nested object of Arg, if it exists.
Definition: nested_object.hpp:34