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;
84 static constexpr
bool is_triangular_adapter =
false;
constexpr bool one_dimensional
Specifies that a type is one-dimensional in every index.
Definition: one_dimensional.hpp:56
triangle_type
The type of a triangular matrix.
Definition: enumerations.hpp:26
The concept, trait, or restraint is permitted, but whether it applies is not necessarily known at com...
constexpr auto count_indices(const T &)
Get the number of indices necessary to address all the components of an indexible object...
Definition: count_indices.hpp:51
Definition: eigen-comma-initializers.hpp:20
decltype(auto) constexpr get_pattern_collection(T &&t)
Get the coordinates::pattern_collection associated with indexible object T.
Definition: get_pattern_collection.hpp:59
A diagonal matrix (both a lower-left and an upper-right triangular matrix).
The root namespace for OpenKalman.
Definition: basics.hpp:34
Definition: object_traits.hpp:38
Trait object providing get and set routines.
Definition: eigen-forward-declarations.hpp:502
decltype(auto) constexpr nested_object(Arg &&arg)
Retrieve a nested object of Arg, if it exists.
Definition: nested_object.hpp:35