16 #ifndef OPENKALMAN_EIGEN_TRAITS_PRODUCT_HPP 17 #define OPENKALMAN_EIGEN_TRAITS_PRODUCT_HPP 19 #include <type_traits> 24 template<
typename LhsType,
typename RhsType,
int Option>
30 using Xpr = Eigen::Product<LhsType, RhsType, Option>;
35 using typename Base::scalar_type;
41 template<
typename Arg>
42 static constexpr
auto get_constant(
const Arg& arg)
44 if constexpr (zero<LhsType>)
48 else if constexpr (zero<RhsType>)
52 else if constexpr (constant_diagonal_matrix<LhsType> and constant_matrix<RhsType>)
55 std::multiplies<scalar_type>{},
56 constant_diagonal_value{arg.lhs()},
59 else if constexpr (constant_matrix<LhsType> and constant_diagonal_matrix<RhsType>)
62 std::multiplies<scalar_type>{},
64 constant_diagonal_value{arg.rhs()});
68 constexpr
auto dim = dynamic_dimension<LhsType, 1> ? index_dimension_of_v<RhsType, 0> : index_dimension_of_v<LhsType, 1>;
69 if constexpr (dim == stdex::dynamic_extent)
72 std::multiplies<scalar_type>{},
73 get_index_dimension_of<1>(arg.lhs()),
79 std::multiplies<scalar_type>{},
86 std::multiplies<scalar_type>{},
94 template<
typename Arg>
95 static constexpr
auto get_constant_diagonal(
const Arg& arg)
98 constant_diagonal_value{arg.lhs()}, constant_diagonal_value{arg.rhs()});
102 template<triangle_type t>
103 static constexpr
bool triangle_type_value = triangular_matrix<LhsType, t> and triangular_matrix<RhsType, t>;
106 static constexpr
bool is_triangular_adapter =
false;
110 static constexpr
bool is_hermitian =
111 (constant_diagonal_matrix<LhsType> and
114 (constant_diagonal_matrix<RhsType> and
115 (not values::
complex<scalar_type_of_t<RhsType>> or values::
not_complex<constant_diagonal_value<RhsType>>) and
Definition: basics.hpp:41
applicability
The applicability of a concept, trait, or restraint.
Definition: constants.hpp:35
The concept, trait, or restraint is permitted, but whether it applies is not necessarily known at com...
constexpr bool complex
T is a value that reduces to std::complex or a custom complex type.
Definition: complex.hpp:47
Definition: eigen-comma-initializers.hpp:20
constexpr bool not_complex
T is a value in which either its type is not complex or its imaginary component is 0...
Definition: not_complex.hpp:48
constexpr bool hermitian_matrix
Specifies that a type is a hermitian matrix.
Definition: hermitian_matrix.hpp:59
Definition: object_traits.hpp:38
Trait object providing get and set routines.
Definition: eigen-forward-declarations.hpp:502
constexpr auto constant_value(T &&t)
The constant value associated with a constant_object or constant_diagonal_object. ...
Definition: constant_value.hpp:37
constexpr bool fixed
T is a value that is determinable at compile time.
Definition: fixed.hpp:66
constexpr auto operation(Operation &&op, Args &&...args)
A potentially constant-evaluated operation involving some number of values.
Definition: operation.hpp:98