16 #ifndef OPENKALMAN_MAKE_HERMITIAN_MATRIX_HPP 17 #define OPENKALMAN_MAKE_HERMITIAN_MATRIX_HPP 28 template<HermitianAdapterType adapter_type = HermitianAdapterType::lower, square_shaped<Applicability::permitted> Arg>
33 square_shaped<Arg, Applicability::permitted> and
35 constexpr decltype(
auto)
41 if constexpr (hermitian_matrix<Arg, Applicability::permitted>)
43 if constexpr (hermitian_matrix<Arg>)
44 return std::forward<Arg>(arg);
45 else if constexpr (hermitian_adapter<Arg, adapter_type>)
46 return make_hermitian_matrix<adapter_type>(
nested_object(std::forward<Arg>(arg)));
47 else if constexpr (hermitian_adapter<Arg>)
48 return make_hermitian_matrix<transp>(
nested_object(std::forward<Arg>(arg)));
52 else if constexpr (triangular_adapter<Arg>)
55 return make_hermitian_matrix<adapter_type>(
nested_object(std::forward<Arg>(arg)));
57 return make_hermitian_matrix<transp>(
nested_object(std::forward<Arg>(arg)));
59 else if constexpr (interface::make_hermitian_adapter_defined_for<Arg, adapter_type, Arg>)
62 auto new_h {Traits::template make_hermitian_adapter<adapter_type>(std::forward<Arg>(arg))};
65 else return make_hermitian_matrix<adapter_type>(std::move(new_h));
77 #endif //OPENKALMAN_MAKE_HERMITIAN_MATRIX_HPP A hermitian matrix wrapper.
Definition: HermitianAdapter.hpp:31
decltype(auto) constexpr make_hermitian_matrix(Arg &&arg)
Creates a hermitian_matrix by, if necessary, wrapping the argument in a hermitian_adapter.
Definition: make_hermitian_matrix.hpp:37
HermitianAdapterType
The type of a hermitian adapter, indicating which triangle of the nested matrix is used...
Definition: global-definitions.hpp:78
An upper-right triangular matrix.
constexpr bool triangular_matrix
Specifies that a type is a triangular matrix (upper, lower, or diagonal).
Definition: triangular_matrix.hpp:37
The root namespace for OpenKalman.
Definition: basics.hpp:34
An interface to various routines from the linear algebra library associated with indexible object T...
Definition: library_interface.hpp:37
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
A lower-left triangular matrix.
constexpr bool hermitian_matrix
Specifies that a type is a hermitian matrix (assuming it is square_shaped).
Definition: hermitian_matrix.hpp:50