7 #ifndef LIN_GENERATORS_IDENTITY_HPP_ 8 #define LIN_GENERATORS_IDENTITY_HPP_ 10 #include "stream_identity.hpp" 11 #include "../core.hpp" 13 #include <type_traits> 32 template <
typename T,
size_t R,
size_t C,
size_t MR = R,
size_t MC = C>
33 constexpr
auto identity(
size_t r = MR,
size_t c = MC) {
48 template <class C, std::enable_if_t<internal::has_traits<C>::value,
size_t> = 0>
49 constexpr
auto identity(
size_t r = C::Traits::max_rows,
size_t c = C::Traits::max_cols) {
50 return identity<typename C::Traits::elem_t, C::Traits::rows, C::Traits::cols, C::Traits::max_rows, C::Traits::max_cols>(r, c);
constexpr auto identity(size_t r=C::Traits::max_rows, size_t c=C::Traits::max_cols)
Creates a stream which evaluates to an identity matrix.
Definition: identity.hpp:49
Tensor stream where all element accesses specify an identity matrix.
Definition: stream_identity.hpp:33
Definition: config.hpp:27