16 #ifndef OPENKALMAN_EIGEN_TRIANGULARVIEW_HPP 17 #define OPENKALMAN_EIGEN_TRIANGULARVIEW_HPP 26 template<
typename MatrixType,
unsigned int Mode>
31 using Xpr = Eigen::TriangularView<MatrixType, Mode>;
32 using IndexType =
typename MatrixType::Index;
36 using scalar_type = scalar_type_of_t<MatrixType>;
39 template<
typename Arg>
43 template<
typename Arg,
typename N>
50 template<
typename Arg>
53 return std::forward<Arg>(arg).nestedExpression();
57 template<
typename Arg>
58 static constexpr
auto get_constant(
const Arg& arg)
60 if constexpr (zero<MatrixType> or ((Mode & Eigen::ZeroDiag) != 0 and diagonal_matrix<MatrixType>))
63 return std::monostate{};
67 template<
typename Arg>
68 static constexpr
auto get_constant_diagonal(
const Arg& arg)
70 using Scalar = scalar_type_of_t<MatrixType>;
72 if constexpr ((Mode & Eigen::UnitDiag) != 0 and (
73 ((Mode & Eigen::Upper) != 0 and triangular_matrix<MatrixType, triangle_type::lower>) or
74 ((Mode & Eigen::Lower) != 0 and triangular_matrix<MatrixType, triangle_type::upper>)))
78 else if constexpr ((Mode & Eigen::ZeroDiag) != 0 and (
79 ((Mode & Eigen::Upper) != 0 and triangular_matrix<MatrixType, triangle_type::lower>) or
80 ((Mode & Eigen::Lower) != 0 and triangular_matrix<MatrixType, triangle_type::upper>)))
86 return constant_diagonal_value {arg.nestedExpression()};
91 template<applicability b>
92 static constexpr
bool one_dimensional = OpenKalman::one_dimensional<MatrixType, b>;
95 template<applicability b>
96 static constexpr
bool is_square = square_shaped<MatrixType, b>;
107 static constexpr
triangle_type triangle_type_value = Eigen_tri * triangle_type_of_v<MatrixType>;
110 static constexpr
bool is_triangular_adapter =
true;
113 static constexpr
bool is_hermitian = diagonal_matrix<MatrixType> and (not values::complex<scalar_type> or
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
Definition for triangular_matrix.
Definition: fixed_value.hpp:41
A lower-left triangular matrix.
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
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
The root namespace for OpenKalman.
Definition: basics.hpp:34
Definition: object_traits.hpp:38
An upper-right triangular matrix.
Definition for triangle_type_of.
decltype(auto) constexpr nested_object(Arg &&arg)
Retrieve a nested object of Arg, if it exists.
Definition: nested_object.hpp:35