16 #ifndef OPENKALMAN_TO_DIAGONAL_HPP 17 #define OPENKALMAN_TO_DIAGONAL_HPP 26 template<indexible Arg>
29 template<
typename Arg, std::enable_if_t<indexible<Arg>,
int> = 0>
30 constexpr decltype(
auto)
34 if constexpr (one_dimensional<Arg>)
36 return std::forward<Arg>(arg);
38 else if constexpr (interface::to_diagonal_defined_for<Arg, Arg&&>)
51 #endif //OPENKALMAN_TO_DIAGONAL_HPP constexpr bool diagonal_matrix
Specifies that a type is a diagonal matrix or tensor.
Definition: diagonal_matrix.hpp:32
decltype(auto) constexpr to_diagonal(Arg &&arg)
Convert an indexible object into a diagonal matrix.
Definition: to_diagonal.hpp:32
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
An adapter for creating a diagonal matrix or tensor.
Definition: DiagonalAdapter.hpp:27