1 #ifndef EAGINE_MATH_MATRIX_IDENTITY_HPP
9 #define EAGINE_MATH_MATRIX_IDENTITY_HPP
19 template <
typename T,
int R,
int C,
bool RM,
bool V>
20 struct is_matrix_constructor<identity<matrix<T, R, C, RM, V>>>
27 template <
typename T,
int R,
int C,
bool RM,
bool V>
28 class identity<
matrix<T, R, C, RM, V>> {
32 using _riS = _make_useq<RM ? R : C>;
33 return _identity(_riS());
38 using _useq = std::integer_sequence<int, U...>;
41 using _make_useq = std::make_integer_sequence<int, N>;
44 static constexpr
auto _identity(_useq<I...>) noexcept
46 return {{vect::axis < T, RM ? C : R, I, V > ::apply(1)...}};
51 template <
typename T,
int C,
int R,
bool RM1,
bool RM2,
bool V>
53 const identity<matrix<T, C, R, RM1, V>>&,
54 const identity<matrix<T, C, R, RM2, V>>&) noexcept
55 -> identity<matrix<T, C, R, RM1, V>> {
67 typename = std::enable_if_t<
68 is_matrix_constructor_v<MC> &&
69 are_multiplicable<constructed_matrix_t<MC>, matrix<T, C, R, RM, V>>::value>>
71 multiply(
const MC& mc,
const identity<matrix<T, C, R, RM, V>>&) noexcept -> MC {
82 typename = std::enable_if_t<
83 is_matrix_constructor_v<MC> &&
84 are_multiplicable<matrix<T, C, R, RM, V>, constructed_matrix_t<MC>>::value>>
86 multiply(
const identity<matrix<T, C, R, RM, V>>&,
const MC& mc) noexcept -> MC {
91 template <
typename T,
int R,
int C,
bool RM,
bool V>
93 reorder_mat_ctr(
const identity<matrix<T, R, C, RM, V>>&) noexcept
94 -> identity<matrix<T, R, C, !RM, V>> {
100 #endif // EAGINE_MATH_MATRIX_IDENTITY_HPP