OpenKalman
NestByValue.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) 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_EIGEN_TRAITS_NESTBYVALUE_HPP
17 #define OPENKALMAN_EIGEN_TRAITS_NESTBYVALUE_HPP
18 
19 #include <type_traits>
20 
21 
22 namespace OpenKalman::interface
23 {
24  template<typename ExpressionType>
25  struct indexible_object_traits<Eigen::NestByValue<ExpressionType>>
26  : Eigen3::indexible_object_traits_base<Eigen::NestByValue<ExpressionType>>
27  {
28  private:
29 
31 
32  public:
33 
34  template<typename Arg, typename N>
35  static constexpr auto get_vector_space_descriptor(const Arg& arg, N n)
36  {
37  return OpenKalman::get_vector_space_descriptor(arg.nestedExpression(), n);
38  }
39 
40 
41  template<typename Arg>
42  static const ExpressionType& nested_object(Arg&& arg)
43  {
44  return std::forward<Arg>(arg).nestedExpression();
45  }
46 
47 
48  template<typename Arg>
49  static constexpr auto get_constant(const Arg& arg)
50  {
51  return constant_coefficient {arg.nestedExpression()};
52  }
53 
54 
55  template<typename Arg>
56  static constexpr auto get_constant_diagonal(const Arg& arg)
57  {
58  return constant_diagonal_coefficient {arg.nestedExpression()};
59  }
60 
61 
62  template<Applicability b>
63  static constexpr bool one_dimensional = OpenKalman::one_dimensional<ExpressionType, b>;
64 
65 
66  template<Applicability b>
67  static constexpr bool is_square = square_shaped<ExpressionType, b>;
68 
69 
70  template<TriangleType t>
71  static constexpr bool is_triangular = triangular_matrix<ExpressionType, t>;
72 
73 
74  static constexpr bool is_triangular_adapter = false;
75 
76 
77  static constexpr bool is_hermitian = hermitian_matrix<ExpressionType, Applicability::permitted>;
78 
79 
80  static constexpr Layout layout = layout_of_v<ExpressionType>;
81  };
82 
83 
84 } // namespace OpenKalman::interface
85 
86 #endif //OPENKALMAN_EIGEN_TRAITS_NESTBYVALUE_HPP
constexpr bool one_dimensional
Specifies that a type is one-dimensional in every index.
Definition: one_dimensional.hpp:83
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
The constant associated with T, assuming T is a constant_matrix.
Definition: constant_coefficient.hpp:36
The constant associated with T, assuming T is a constant_diagonal_matrix.
Definition: constant_diagonal_coefficient.hpp:32
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
constexpr auto get_vector_space_descriptor(const T &t, const N &n)
Get the coordinates::pattern object for index N of indexible object T.
Definition: get_vector_space_descriptor.hpp:56