22 #ifndef PLAYRHO_COMMON_MATRIX_HPP
23 #define PLAYRHO_COMMON_MATRIX_HPP
38 template <
typename T, std::
size_t M, std::
size_t N>
67 template <
typename T, std::
size_t M, std::
size_t N>
92 template <
typename T, std::
size_t M>
100 template <
typename T, std::
size_t N>
105 for (
auto i = std::size_t{0}; i < N; ++i)
115 template <
typename T>
118 return GetIdentityMatrix<typename T::value_type::value_type, std::tuple_size<T>::value>();
122 template <
typename T, std::
size_t N>
130 template <
typename T, std::
size_t N>
135 for (
auto i = std::size_t{0}; i < N; ++i)
137 result[i][0] = arg[i];
144 template <
typename T, std::
size_t M, std::
size_t N>
149 for (
auto m = decltype(M){0}; m < M; ++m)
151 for (
auto n = decltype(N){0}; n < N; ++n)
153 result[m][n] = lhs[m][n] + rhs[m][n];
161 template <
typename T, std::
size_t M, std::
size_t N>
166 for (
auto m = decltype(M){0}; m < M; ++m)
168 for (
auto n = decltype(N){0}; n < N; ++n)
170 result[m][n] = lhs[m][n] - rhs[m][n];
177 template <
typename T>
181 template <
typename T>
207 return Mat22{GetInvalid<Vec2>(), GetInvalid<Vec2>()};
212 #endif // PLAYRHO_COMMON_MATRIX_HPP