OpenKalman
indexible_object_traits_tensor_base.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-2024 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_INDEXIBLE_OBJECT_TRAITS_TENSOR_BASE_HPP
17 #define OPENKALMAN_INDEXIBLE_OBJECT_TRAITS_TENSOR_BASE_HPP
18 
19 #include <type_traits>
20 #include <tuple>
21 
22 
23 namespace OpenKalman::Eigen3
24 {
25 #ifdef __cpp_concepts
26  template<Eigen3::eigen_tensor_general T>
27  struct indexible_object_traits_tensor_base<T>
28 #else
29  template<typename T>
30  struct indexible_object_traits_tensor_base<T, std::enable_if_t<Eigen3::eigen_tensor_general<T>>>
31 #endif
32  {
33  using scalar_type = typename Eigen::internal::traits<T>::Scalar;
34 
35 
36  template<typename Arg>
37  static constexpr auto
38  count_indices(const Arg& arg)
39  {
40  return std::integral_constant<std::size_t, Eigen::internal::traits<T>::NumDimensions>{};
41  }
42 
43  };
44 
45 
46 } // namespace OpenKalman::Eigen3
47 
48 
49 #endif //OPENKALMAN_INDEXIBLE_OBJECT_TRAITS_TENSOR_BASE_HPP
constexpr auto count_indices(const T &t)
Get the number of indices available to address the components of an indexible object.
Definition: count_indices.hpp:33
Definition: tuple_reverse.hpp:103
Trait object providing get and set routines for Eigen tensors.
Definition: eigen-tensor-forward-declarations.hpp:114
Definition: eigen-forward-declarations.hpp:22