16 #ifndef OPENKALMAN_EIGEN_TRAITS_DIAGONALMATRIX_HPP 17 #define OPENKALMAN_EIGEN_TRAITS_DIAGONALMATRIX_HPP 19 #include <type_traits> 26 template<
typename Scalar,
int SizeAtCompileTime,
int MaxSizeAtCompileTime>
32 using Xpr = Eigen::DiagonalMatrix<Scalar, SizeAtCompileTime, MaxSizeAtCompileTime>;
37 template<
typename Arg>
41 if constexpr (SizeAtCompileTime == 1)
42 return std::integral_constant<std::size_t, 0_uz>{};
44 return std::integral_constant<std::size_t, 2_uz>{};
48 template<
typename Arg,
typename N>
51 if constexpr (SizeAtCompileTime == Eigen::Dynamic)
return static_cast<std::size_t
>(arg.rows());
52 else return Dimensions<SizeAtCompileTime>{};
56 template<
typename Arg>
60 if constexpr (std::is_rvalue_reference_v<Arg&&>)
61 return std::move(arg.diagonal());
63 return arg.diagonal();
73 template<Applicability b>
77 template<Applicability b>
78 static constexpr
bool is_square =
true;
81 template<TriangleType t>
82 static constexpr
bool is_triangular =
true;
85 static constexpr
bool is_triangular_adapter =
false;
99 #endif //OPENKALMAN_EIGEN_TRAITS_DIAGONALMATRIX_HPP constexpr auto count_indices(const T &t)
Get the number of indices available to address the components of an indexible object.
Definition: count_indices.hpp:33
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
Trait object providing get and set routines.
Definition: eigen-forward-declarations.hpp:502
Definition: eigen-comma-initializers.hpp:20
The root namespace for OpenKalman.
Definition: basics.hpp:34
The concept, trait, or restraint is permitted, but whether it applies is not necessarily known at com...
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