16 #ifndef OPENKALMAN_EIGEN_TRAITS_CWISEUNARYVIEW_HPP 17 #define OPENKALMAN_EIGEN_TRAITS_CWISEUNARYVIEW_HPP 19 #include <type_traits> 24 template<
typename ViewOp,
typename MatrixType>
30 using Xpr = Eigen::CwiseUnaryView<ViewOp, MatrixType>;
36 template<
typename Arg,
typename N>
43 template<
typename Arg>
46 return std::forward<Arg>(arg).nestedExpression();
51 #ifndef __cpp_concepts 52 template<
typename T,
typename =
void>
53 struct custom_get_constant_defined : std::false_type {};
56 struct custom_get_constant_defined<T, std::void_t<decltype(T::template get_constant(std::declval<const Xpr&>()))>>
63 get_constant(
const Xpr& arg)
66 if constexpr (requires { Traits::get_constant(arg); })
70 return Traits::template get_constant(arg);
72 else if constexpr (Eigen3::constexpr_unary_operation_defined<ViewOp>)
84 #ifndef __cpp_concepts 85 template<
typename T,
typename =
void>
86 struct custom_get_constant_diagonal_defined : std::false_type {};
89 struct custom_get_constant_diagonal_defined<T, std::void_t<decltype(T::template get_constant_diagonal<MatrixType>(std::declval<const Xpr&>()))>>
96 get_constant_diagonal(
const Xpr& arg)
99 if constexpr (requires { Traits::get_constant_diagonal(arg); })
103 return Traits::template get_constant_diagonal<MatrixType>(arg);
104 else if constexpr (not Traits::preserves_triangle)
105 return std::monostate{};
106 else if constexpr (Eigen3::constexpr_unary_operation_defined<ViewOp>)
113 template<Applicability b>
114 static constexpr
bool one_dimensional = OpenKalman::one_dimensional<MatrixType, b>;
117 template<Applicability b>
118 static constexpr
bool is_square = square_shaped<MatrixType, b>;
121 static constexpr
bool is_triangular_adapter =
false;
124 template<TriangleType t>
125 static constexpr
bool is_triangular = Traits::preserves_triangle and triangular_matrix<MatrixType, t>;
128 static constexpr
bool is_hermitian = Traits ::preserves_hermitian and hermitian_matrix<MatrixType, Applicability::permitted>;
134 #endif //OPENKALMAN_EIGEN_TRAITS_CWISEUNARYVIEW_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
constexpr bool fixed
T is a values::value that is determinable at compile time.
Definition: fixed.hpp:60
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