16 #ifndef OPENKALMAN_EIGEN_TRAITS_REPLICATE_HPP 17 #define OPENKALMAN_EIGEN_TRAITS_REPLICATE_HPP 19 #include <type_traits> 24 template<
typename MatrixType,
int RowFactor,
int ColFactor>
30 using Xpr = Eigen::Replicate<MatrixType, RowFactor, ColFactor>;
35 using typename Base::scalar_type;
38 template<
typename Arg>
41 return std::forward<Arg>(arg).nestedExpression();
45 template<
typename Arg>
46 static constexpr
auto get_constant(
const Arg& arg)
52 template<
typename Arg>
53 static constexpr
auto get_constant_diagonal(
const Arg& arg)
56 else return std::monostate {};
60 template<Applicability b>
63 (RowFactor == 1 or RowFactor == Eigen::Dynamic) and
64 (ColFactor == 1 or ColFactor == Eigen::Dynamic) and
65 OpenKalman::one_dimensional<MatrixType, b>;
68 template<Applicability b>
69 static constexpr
bool is_square =
71 (RowFactor == Eigen::Dynamic or ColFactor == Eigen::Dynamic or
72 ((RowFactor != ColFactor or square_shaped<MatrixType, b>) and
73 (dynamic_dimension<MatrixType, 0> or RowFactor * index_dimension_of_v<MatrixType, 0> % ColFactor == 0) and
74 (dynamic_dimension<MatrixType, 1> or ColFactor * index_dimension_of_v<MatrixType, 1> % RowFactor == 0))) and
75 (has_dynamic_dimensions<MatrixType> or
76 ((RowFactor == Eigen::Dynamic or index_dimension_of_v<MatrixType, 0> * RowFactor % index_dimension_of_v<MatrixType, 1> == 0) and
77 (ColFactor == Eigen::Dynamic or index_dimension_of_v<MatrixType, 1> * ColFactor % index_dimension_of_v<MatrixType, 0> == 0)));
80 template<TriangleType t>
81 static constexpr
bool is_triangular = triangular_matrix<MatrixType, t> and
87 static constexpr
bool is_triangular_adapter =
false;
90 static constexpr
bool is_hermitian = hermitian_matrix<MatrixType, Applicability::permitted> and
91 ((RowFactor == 1 and ColFactor == 1) or not values::complex<scalar_type> or
98 #endif //OPENKALMAN_EIGEN_TRAITS_REPLICATE_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
Lower, upper, or diagonal matrix.
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
An upper-right triangular matrix.
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
A diagonal matrix (both a lower-left and an upper-right triangular matrix).
decltype(auto) constexpr nested_object(Arg &&arg)
Retrieve a nested object of Arg, if it exists.
Definition: nested_object.hpp:34
The concept, trait, or restraint represents a compile-time guarantee.
A lower-left triangular matrix.