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>{},
59 else if constexpr (constant_matrix<LhsType> and constant_diagonal_matrix<RhsType>)
62 std::multiplies<scalar_type>{},
68 constexpr
auto dim = dynamic_dimension<LhsType, 1> ? index_dimension_of_v<RhsType, 0> : index_dimension_of_v<LhsType, 1>;
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)
102 template<TriangleType t>
103 static constexpr
bool is_triangular = 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
123 #endif //OPENKALMAN_EIGEN_TRAITS_PRODUCT_HPP 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
typename scalar_type_of< T >::type scalar_type_of_t
helper template for scalar_type_of.
Definition: scalar_type_of.hpp:54
constexpr bool complex
T is a values::value that reduces to std::complex or a custom complex type.
Definition: complex.hpp:46
Definition: eigen-comma-initializers.hpp:20
constexpr bool not_complex
T is a values::value in which either its type is not a values::complex or its imaginary component is ...
Definition: not_complex.hpp:47
constexpr bool constant_diagonal_matrix
Specifies that all diagonal elements of a diagonal object are the same constant value.
Definition: constant_diagonal_matrix.hpp:34
The constant associated with T, assuming T is a constant_matrix.
Definition: constant_coefficient.hpp:36
The concept, trait, or restraint is permitted, but whether it applies is not necessarily known at com...
The constant associated with T, assuming T is a constant_diagonal_matrix.
Definition: constant_diagonal_coefficient.hpp:32
Applicability
The applicability of a concept, trait, or restraint.
Definition: global-definitions.hpp:93
constexpr bool fixed
T is a values::value that is determinable at compile time.
Definition: fixed.hpp:60
constexpr std::size_t dynamic_size
A constant indicating that a size or index is dynamic.
Definition: global-definitions.hpp:33
constexpr bool hermitian_matrix
Specifies that a type is a hermitian matrix (assuming it is square_shaped).
Definition: hermitian_matrix.hpp:50