16 #ifndef OPENKALMAN_EIGEN_TRAITS_CWISEUNARYOP_HPP 17 #define OPENKALMAN_EIGEN_TRAITS_CWISEUNARYOP_HPP 22 template<
typename UnaryOp,
typename XprType>
28 using Xpr = Eigen::CwiseUnaryOp<UnaryOp, XprType>;
33 struct is_bind_operator : std::false_type {};
35 template<
typename BinaryOp>
36 struct is_bind_operator<Eigen::internal::bind1st_op<BinaryOp>> : std::true_type {};
38 template<
typename BinaryOp>
39 struct is_bind_operator<Eigen::internal::bind2nd_op<BinaryOp>> : std::true_type {};
43 template<
typename Arg,
typename N>
51 template<
typename Arg>
55 return std::as_const(arg).nestedExpression();
60 #ifndef __cpp_concepts 61 template<
typename T,
typename =
void>
62 struct custom_get_constant_defined : std::false_type {};
65 struct custom_get_constant_defined<T, std::void_t<decltype(T::get_constant(std::declval<const Xpr&>()))>>
72 get_constant(
const Xpr& arg)
75 if constexpr (requires { Traits::get_constant(arg); })
79 return Traits::get_constant(arg);
80 else if constexpr (Eigen3::constexpr_unary_operation_defined<UnaryOp>)
88 #ifndef __cpp_concepts 89 template<
typename T,
typename =
void>
90 struct custom_get_constant_diagonal_defined : std::false_type {};
93 struct custom_get_constant_diagonal_defined<T, std::void_t<decltype(T::get_constant_diagonal(std::declval<const Xpr&>()))>>
100 get_constant_diagonal(
const Xpr& arg)
102 #ifdef __cpp_concepts 103 if constexpr (requires { Traits::get_constant_diagonal(arg); })
107 return Traits::get_constant_diagonal(arg);
108 else if constexpr (not Traits::preserves_triangle)
109 return std::monostate{};
110 else if constexpr (Eigen3::constexpr_unary_operation_defined<UnaryOp>)
117 template<Applicability b>
118 static constexpr
bool one_dimensional = OpenKalman::one_dimensional<XprType, b>;
121 template<Applicability b>
122 static constexpr
bool is_square = square_shaped<XprType, b>;
125 static constexpr
bool is_triangular_adapter =
false;
128 template<TriangleType t>
129 static constexpr
bool is_triangular = Traits::preserves_triangle and triangular_matrix<XprType, t>;
132 static constexpr
bool is_hermitian = Traits::preserves_hermitian and hermitian_matrix<XprType, Applicability::permitted>;
139 #endif //OPENKALMAN_EIGEN_TRAITS_CWISEUNARYOP_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
An operation involving some number of values.
Definition: operation.hpp:69
Trait object providing get and set routines.
Definition: eigen-forward-declarations.hpp:502
Definition: eigen-forward-declarations.hpp:41
Definition: eigen-comma-initializers.hpp:20
constexpr bool value
T is numerical value or is reducible to a numerical value.
Definition: value.hpp:31
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
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