OpenKalman
EigenTensorAdapterBase.hpp
1 /* This file is part of OpenKalman, a header-only C++ library for
2  * Kalman filters and other recursive filters.
3  *
4  * Copyright (c) 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 
17 #ifndef OPENKALMAN_EIGENTENSORADAPTERBASE_HPP
18 #define OPENKALMAN_EIGENTENSORADAPTERBASE_HPP
19 
20 namespace OpenKalman::Eigen3
21 {
22  template<typename Derived, typename NestedMatrix>
23  struct EigenTensorAdapterBase : EigenCustomBase,
24  Eigen::TensorBase<Derived, Eigen::internal::accessors_level<std::decay_t<NestedMatrix>>::value>
25  {
26 
27  private:
28 
29  using Base = Eigen::TensorBase<Derived, Eigen::internal::accessors_level<std::decay_t<NestedMatrix>>::value>;
30 
31  public:
32 
33  EigenTensorAdapterBase() = default;
34 
35  EigenTensorAdapterBase(const EigenTensorAdapterBase&) = default;
36 
37  EigenTensorAdapterBase(EigenTensorAdapterBase&&) = default;
38 
39  ~EigenTensorAdapterBase() = default;
40 
41  using Base::operator=;
42 
43  using typename Base::Scalar;
44 
45  /* \internal
46  * \brief The underlying numeric type for composed scalar types.
47  * \details In cases where Scalar is e.g. std::complex<T>, T were corresponding to RealScalar.
48  */
49  using RealScalar = typename Eigen::NumTraits<Scalar>::Real;
50 
51 
57  using Nested = Derived;
58 
59  using StorageKind [[maybe_unused]] = typename Eigen::internal::traits<Derived>::StorageKind;
60 
61  };
62 
63 } // namespace OpenKalman::Eigen3
64 
65 
66 #endif //OPENKALMAN_EIGENTENSORADAPTERBASE_HPP
constexpr bool value
T is numerical value or is reducible to a numerical value.
Definition: value.hpp:31
Definition: eigen-forward-declarations.hpp:22