OpenKalman
CwiseNullaryOp.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) 2023-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_CWISENULLARYOP_HPP
17 #define OPENKALMAN_EIGEN_TRAITS_CWISENULLARYOP_HPP
18 
19 #include <type_traits>
20 
21 
22 namespace OpenKalman::interface
23 {
24  template<typename NullaryOp, typename PlainObjectType>
25  struct indexible_object_traits<Eigen::CwiseNullaryOp<NullaryOp, PlainObjectType>>
26  : Eigen3::indexible_object_traits_base<Eigen::CwiseNullaryOp<NullaryOp, PlainObjectType>>
27  {
28  private:
29 
31 
33 
34  template<typename T>
35  struct has_params : std::bool_constant<
36  Eigen::CwiseNullaryOp<NullaryOp, PlainObjectType>::RowsAtCompileTime == Eigen::Dynamic or
37  Eigen::CwiseNullaryOp<NullaryOp, PlainObjectType>::ColsAtCompileTime == Eigen::Dynamic> {};
38 
39  template<typename Scalar>
40  struct has_params<Eigen::internal::scalar_constant_op<Scalar>> : std::true_type {};
41 
42  template<typename...Args>
43  struct has_params<Eigen::internal::linspaced_op<Args...>> : std::true_type {};
44 
45  public:
46 
47  // nested_object() not defined
48 
49 
50  template<typename Arg>
51  static constexpr auto get_constant(const Arg& arg)
52  {
53  return NullaryTraits::template get_constant(arg);
54  }
55 
56 
57  template<typename Arg>
58  static constexpr auto get_constant_diagonal(const Arg& arg)
59  {
60  return NullaryTraits::template get_constant_diagonal(arg);
61  }
62 
63 
64  template<Applicability b>
65  static constexpr bool one_dimensional = OpenKalman::one_dimensional<PlainObjectType, b>;
66 
67 
68  template<Applicability b>
69  static constexpr bool is_square = square_shaped<PlainObjectType, b>;
70 
71 
72  template<TriangleType t>
73  static constexpr bool is_triangular = NullaryTraits::template is_triangular<t>;
74 
75 
76  static constexpr bool is_triangular_adapter = false;
77 
78 
79  static constexpr bool is_hermitian = NullaryTraits::is_hermitian;
80 
81  };
82 
83 
84 } // namespace OpenKalman::interface
85 
86 #endif //OPENKALMAN_EIGEN_TRAITS_CWISENULLARYOP_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-forward-declarations.hpp:32
Definition: eigen-comma-initializers.hpp:20