1 template <u
int8_t Rows, u
int8_t Columns,
typename T>
3 static_assert(std::is_arithmetic<T>::value,
"Can't construct matrix with non integral type");
5 for (uint8_t row = 0; row < Rows; ++row) {
6 for (uint8_t col = 0; col < Columns; ++col) {
7 (*this)(row, col) = value;
12 template <u
int8_t Rows, u
int8_t Columns,
typename T>
14 LUG_ASSERT(values.size() == Rows * Columns,
"Matrix construct with bad size initializer list");
17 template <u
int8_t Rows, u
int8_t Columns,
typename T>
19 LUG_ASSERT(list.size() == Rows * Columns,
"Matrix construct with bad size initializer list");
21 auto it = std::begin(list);
22 for (uint8_t row = 0; row < Rows; ++row) {
23 for (uint8_t col = 0; col < Columns; ++col) {
24 (*this)(row, col) = *it;
31 template <u
int8_t Rows, u
int8_t Columns,
typename T>
36 template <u
int8_t Rows, u
int8_t Columns,
typename T>
41 template <u
int8_t Rows, u
int8_t Columns,
typename T>
46 template <u
int8_t Rows, u
int8_t Columns,
typename T>
51 template <u
int8_t Rows, u
int8_t Columns,
typename T>
53 return _values[col * Rows + row];
56 template <u
int8_t Rows, u
int8_t Columns,
typename T>
58 return _values[col * Rows + row];
63 template <u
int8_t Rows, u
int8_t Columns,
typename T>
69 template <u
int8_t Rows, u
int8_t Columns,
typename T>
75 template <u
int8_t Rows, u
int8_t Columns,
typename T>
81 template <u
int8_t Rows, u
int8_t Columns,
typename T>
89 template <u
int8_t Rows, u
int8_t Columns,
typename T>
95 template <u
int8_t Rows, u
int8_t Columns,
typename T>
101 template <u
int8_t Rows, u
int8_t Columns,
typename T>
102 #if defined(LUG_COMPILER_MSVC) 106 template <
bool EnableBool>
110 static_assert(Rows == Columns,
"Operator *= is only available for square matrices");
117 template <u
int8_t Rows, u
int8_t Columns,
typename T>
118 #if defined(LUG_COMPILER_MSVC) 122 template <
bool EnableBool>
126 static_assert(Rows == Columns,
"Operator /= is only available for square matrices");
133 template <u
int8_t Rows, u
int8_t Columns,
typename T>
134 #if defined(LUG_COMPILER_MSVC) 138 template <
bool EnableBool>
142 static_assert(Rows == Columns,
"The matrix has to be a square matrix to calculate the inverse");
146 template <u
int8_t Rows, u
int8_t Columns,
typename T>
147 #if defined(LUG_COMPILER_MSVC) 148 template <
typename,
typename>
151 template <
bool EnableBool>
155 static_assert(Rows == Columns,
"The matrix has to be a square matrix to calculate the inverse");
164 template <u
int8_t Rows, u
int8_t Columns,
typename T>
165 #if defined(LUG_COMPILER_MSVC) 166 template <
typename,
typename,
typename>
169 template <
bool EnableBool>
173 static_assert(Rows == Columns,
"The matrix has to be a square matrix to calculate the inverse");
175 (*this)(1, 1) * (*
this)(2, 2) - (*
this)(1, 2) * (*
this)(2, 1),
176 (*
this)(0, 2) * (*
this)(2, 1) - (*
this)(0, 1) * (*
this)(2, 2),
177 (*
this)(0, 1) * (*
this)(1, 2) - (*
this)(0, 2) * (*
this)(1, 1),
179 (*
this)(1, 2) * (*
this)(2, 0) - (*
this)(1, 0) * (*
this)(2, 2),
180 (*
this)(0, 0) * (*
this)(2, 2) - (*
this)(0, 2) * (*
this)(2, 0),
181 (*
this)(0, 2) * (*
this)(1, 0) - (*
this)(0, 0) * (*
this)(1, 2),
183 (*
this)(1, 0) * (*
this)(2, 1) - (*
this)(1, 1) * (*
this)(2, 0),
184 (*
this)(0, 1) * (*
this)(2, 0) - (*
this)(0, 0) * (*
this)(2, 1),
185 (*
this)(0, 0) * (*
this)(1, 1) - (*
this)(0, 1) * (*
this)(1, 0)
189 template <u
int8_t Rows, u
int8_t Columns,
typename T>
190 #if defined(LUG_COMPILER_MSVC) 191 template <
typename,
typename,
typename,
typename>
194 template <
bool EnableBool>
198 static_assert(Rows == Columns,
"The matrix has to be a square matrix to calculate the inverse");
201 (*this)(1, 1) * (*
this)(2, 2) * (*
this)(3, 3)
202 + (*
this)(1, 2) * (*
this)(2, 3) * (*
this)(3, 1)
203 + (*
this)(1, 3) * (*
this)(2, 1) * (*
this)(3, 2)
204 - (*
this)(1, 1) * (*
this)(2, 3) * (*
this)(3, 2)
205 - (*
this)(1, 2) * (*
this)(2, 1) * (*
this)(3, 3)
206 - (*
this)(1, 3) * (*
this)(2, 2) * (*
this)(3, 1),
209 (*
this)(0, 1) * (*
this)(2, 3) * (*
this)(3, 2)
210 + (*
this)(0, 2) * (*
this)(2, 1) * (*
this)(3, 3)
211 + (*
this)(0, 3) * (*
this)(2, 2) * (*
this)(3, 1)
212 - (*
this)(0, 1) * (*
this)(2, 2) * (*
this)(3, 3)
213 - (*
this)(0, 2) * (*
this)(2, 3) * (*
this)(3, 1)
214 - (*
this)(0, 3) * (*
this)(2, 1) * (*
this)(3, 2),
217 (*
this)(0, 1) * (*
this)(1, 2) * (*
this)(3, 3)
218 + (*
this)(0, 2) * (*
this)(1, 3) * (*
this)(3, 1)
219 + (*
this)(0, 3) * (*
this)(1, 1) * (*
this)(3, 2)
220 - (*
this)(0, 1) * (*
this)(1, 3) * (*
this)(3, 2)
221 - (*
this)(0, 2) * (*
this)(1, 1) * (*
this)(3, 3)
222 - (*
this)(0, 3) * (*
this)(1, 2) * (*
this)(3, 1),
225 (*
this)(0, 1) * (*
this)(1, 3) * (*
this)(2, 2)
226 + (*
this)(0, 2) * (*
this)(1, 1) * (*
this)(2, 3)
227 + (*
this)(0, 3) * (*
this)(1, 2) * (*
this)(2, 1)
228 - (*
this)(0, 1) * (*
this)(1, 2) * (*
this)(2, 3)
229 - (*
this)(0, 2) * (*
this)(1, 3) * (*
this)(2, 1)
230 - (*
this)(0, 3) * (*
this)(1, 1) * (*
this)(2, 2),
233 (*
this)(1, 0) * (*
this)(2, 3) * (*
this)(3, 2)
234 + (*
this)(1, 2) * (*
this)(2, 0) * (*
this)(3, 3)
235 + (*
this)(1, 3) * (*
this)(2, 2) * (*
this)(3, 0)
236 - (*
this)(1, 0) * (*
this)(2, 2) * (*
this)(3, 3)
237 - (*
this)(1, 2) * (*
this)(2, 3) * (*
this)(3, 0)
238 - (*
this)(1, 3) * (*
this)(2, 0) * (*
this)(3, 2),
241 (*
this)(0, 0) * (*
this)(2, 2) * (*
this)(3, 3)
242 + (*
this)(0, 2) * (*
this)(2, 3) * (*
this)(3, 0)
243 + (*
this)(0, 3) * (*
this)(2, 0) * (*
this)(3, 2)
244 - (*
this)(0, 0) * (*
this)(2, 3) * (*
this)(3, 2)
245 - (*
this)(0, 2) * (*
this)(2, 0) * (*
this)(3, 3)
246 - (*
this)(0, 3) * (*
this)(2, 2) * (*
this)(3, 0),
249 (*
this)(0, 0) * (*
this)(1, 3) * (*
this)(3, 2)
250 + (*
this)(0, 2) * (*
this)(1, 0) * (*
this)(3, 3)
251 + (*
this)(0, 3) * (*
this)(1, 2) * (*
this)(3, 0)
252 - (*
this)(0, 0) * (*
this)(1, 2) * (*
this)(3, 3)
253 - (*
this)(0, 2) * (*
this)(1, 3) * (*
this)(3, 0)
254 - (*
this)(0, 3) * (*
this)(1, 0) * (*
this)(3, 2),
257 (*
this)(0, 0) * (*
this)(1, 2) * (*
this)(2, 3)
258 + (*
this)(0, 2) * (*
this)(1, 3) * (*
this)(2, 0)
259 + (*
this)(0, 3) * (*
this)(1, 0) * (*
this)(2, 2)
260 - (*
this)(0, 0) * (*
this)(1, 3) * (*
this)(2, 2)
261 - (*
this)(0, 2) * (*
this)(1, 0) * (*
this)(2, 3)
262 - (*
this)(0, 3) * (*
this)(1, 2) * (*
this)(2, 0),
265 (*
this)(1, 0) * (*
this)(2, 1) * (*
this)(3, 3)
266 + (*
this)(1, 1) * (*
this)(2, 3) * (*
this)(3, 0)
267 + (*
this)(1, 3) * (*
this)(2, 0) * (*
this)(3, 1)
268 - (*
this)(1, 0) * (*
this)(2, 3) * (*
this)(3, 1)
269 - (*
this)(1, 1) * (*
this)(2, 0) * (*
this)(3, 3)
270 - (*
this)(1, 3) * (*
this)(2, 1) * (*
this)(3, 0),
273 (*
this)(0, 0) * (*
this)(2, 3) * (*
this)(3, 1)
274 + (*
this)(0, 1) * (*
this)(2, 0) * (*
this)(3, 3)
275 + (*
this)(0, 3) * (*
this)(2, 1) * (*
this)(3, 0)
276 - (*
this)(0, 0) * (*
this)(2, 1) * (*
this)(3, 3)
277 - (*
this)(0, 1) * (*
this)(2, 3) * (*
this)(3, 0)
278 - (*
this)(0, 3) * (*
this)(2, 0) * (*
this)(3, 1),
281 (*
this)(0, 0) * (*
this)(1, 1) * (*
this)(3, 3)
282 + (*
this)(0, 1) * (*
this)(1, 3) * (*
this)(3, 0)
283 + (*
this)(0, 3) * (*
this)(1, 0) * (*
this)(3, 1)
284 - (*
this)(0, 0) * (*
this)(1, 3) * (*
this)(3, 1)
285 - (*
this)(0, 1) * (*
this)(1, 0) * (*
this)(3, 3)
286 - (*
this)(0, 3) * (*
this)(1, 1) * (*
this)(3, 0),
289 (*
this)(0, 0) * (*
this)(1, 3) * (*
this)(2, 1)
290 + (*
this)(0, 1) * (*
this)(1, 0) * (*
this)(2, 3)
291 + (*
this)(0, 3) * (*
this)(1, 1) * (*
this)(2, 0)
292 - (*
this)(0, 0) * (*
this)(1, 1) * (*
this)(2, 3)
293 - (*
this)(0, 1) * (*
this)(1, 3) * (*
this)(2, 0)
294 - (*
this)(0, 3) * (*
this)(1, 0) * (*
this)(2, 1),
297 (*
this)(1, 0) * (*
this)(2, 2) * (*
this)(3, 1)
298 + (*
this)(1, 1) * (*
this)(2, 0) * (*
this)(3, 2)
299 + (*
this)(1, 2) * (*
this)(2, 1) * (*
this)(3, 0)
300 - (*
this)(1, 0) * (*
this)(2, 1) * (*
this)(3, 2)
301 - (*
this)(1, 1) * (*
this)(2, 2) * (*
this)(3, 0)
302 - (*
this)(1, 2) * (*
this)(2, 0) * (*
this)(3, 1),
305 (*
this)(0, 0) * (*
this)(2, 1) * (*
this)(3, 2)
306 + (*
this)(0, 1) * (*
this)(2, 2) * (*
this)(3, 0)
307 + (*
this)(0, 2) * (*
this)(2, 0) * (*
this)(3, 1)
308 - (*
this)(0, 0) * (*
this)(2, 2) * (*
this)(3, 1)
309 - (*
this)(0, 1) * (*
this)(2, 0) * (*
this)(3, 2)
310 - (*
this)(0, 2) * (*
this)(2, 1) * (*
this)(3, 0),
313 (*
this)(0, 0) * (*
this)(1, 2) * (*
this)(3, 1)
314 + (*
this)(0, 1) * (*
this)(1, 0) * (*
this)(3, 2)
315 + (*
this)(0, 2) * (*
this)(1, 1) * (*
this)(3, 0)
316 - (*
this)(0, 0) * (*
this)(1, 1) * (*
this)(3, 2)
317 - (*
this)(0, 1) * (*
this)(1, 2) * (*
this)(3, 0)
318 - (*
this)(0, 2) * (*
this)(1, 0) * (*
this)(3, 1),
321 (*
this)(0, 0) * (*
this)(1, 1) * (*
this)(2, 2)
322 + (*
this)(0, 1) * (*
this)(1, 2) * (*
this)(2, 0)
323 + (*
this)(0, 2) * (*
this)(1, 0) * (*
this)(2, 1)
324 - (*
this)(0, 0) * (*
this)(1, 2) * (*
this)(2, 1)
325 - (*
this)(0, 1) * (*
this)(1, 0) * (*
this)(2, 2)
326 - (*
this)(0, 2) * (*
this)(1, 1) * (*
this)(2, 0)
330 template <u
int8_t Rows, u
int8_t Columns,
typename T>
334 for (uint8_t row = 0; row < Rows; ++row) {
335 for (uint8_t col = 0; col < Columns; ++col) {
336 transposeMatrix(col, row) = (*this)(row, col);
340 return transposeMatrix;
344 template <u
int8_t Rows, u
int8_t Columns,
typename T>
345 #if defined(LUG_COMPILER_MSVC) 349 template <
bool EnableBool>
353 static_assert(Rows == Columns,
"The matrix has to be a square matrix to calculate the determinant");
354 return (*
this)(0, 0);
357 template <u
int8_t Rows, u
int8_t Columns,
typename T>
358 #if defined(LUG_COMPILER_MSVC) 359 template <
typename,
typename>
362 template <
bool EnableBool>
366 static_assert(Rows == Columns,
"The matrix has to be a square matrix to calculate the determinant");
368 (*
this)(0, 0) * (*
this)(1, 1)
369 - (*
this)(0, 1) * (*
this)(1, 0)
373 template <u
int8_t Rows, u
int8_t Columns,
typename T>
374 #if defined(LUG_COMPILER_MSVC) 375 template <
typename,
typename,
typename>
378 template <
bool EnableBool>
382 static_assert(Rows == Columns,
"The matrix has to be a square matrix to calculate the determinant");
384 (*
this)(0, 0) * (*
this)(1, 1) * (*
this)(2, 2)
385 + (*
this)(1, 0) * (*
this)(2, 1) * (*
this)(0, 2)
386 + (*
this)(2, 0) * (*
this)(0, 1) * (*
this)(1, 2)
387 - (*
this)(0, 0) * (*
this)(2, 1) * (*
this)(1, 2)
388 - (*
this)(2, 0) * (*
this)(1, 1) * (*
this)(0, 2)
389 - (*
this)(1, 0) * (*
this)(0, 1) * (*
this)(2, 2)
393 template <u
int8_t Rows, u
int8_t Columns,
typename T>
394 #if defined(LUG_COMPILER_MSVC) 395 template <
typename,
typename,
typename,
typename>
398 template <
bool EnableBool>
402 static_assert(Rows == Columns,
"The matrix has to be a square matrix to calculate the determinant");
404 (*
this)(0, 0) * (*
this)(1, 1) * (*
this)(2, 2) * (*
this)(3, 3)
405 + (*
this)(0, 0) * (*
this)(1, 2) * (*
this)(2, 3) * (*
this)(3, 1)
406 + (*
this)(0, 0) * (*
this)(1, 3) * (*
this)(2, 1) * (*
this)(3, 2)
408 + (*
this)(0, 1) * (*
this)(1, 0) * (*
this)(2, 3) * (*
this)(3, 2)
409 + (*
this)(0, 1) * (*
this)(1, 2) * (*
this)(2, 0) * (*
this)(3, 3)
410 + (*
this)(0, 1) * (*
this)(1, 3) * (*
this)(2, 2) * (*
this)(3, 0)
412 + (*
this)(0, 2) * (*
this)(1, 0) * (*
this)(2, 1) * (*
this)(3, 3)
413 + (*
this)(0, 2) * (*
this)(1, 1) * (*
this)(2, 3) * (*
this)(3, 0)
414 + (*
this)(0, 2) * (*
this)(1, 3) * (*
this)(2, 0) * (*
this)(3, 1)
416 + (*
this)(0, 3) * (*
this)(1, 0) * (*
this)(2, 2) * (*
this)(3, 1)
417 + (*
this)(0, 3) * (*
this)(1, 1) * (*
this)(2, 0) * (*
this)(3, 2)
418 + (*
this)(0, 3) * (*
this)(1, 2) * (*
this)(2, 1) * (*
this)(3, 0)
420 - (*
this)(0, 0) * (*
this)(1, 1) * (*
this)(2, 3) * (*
this)(3, 2)
421 - (*
this)(0, 0) * (*
this)(1, 2) * (*
this)(2, 1) * (*
this)(3, 3)
422 - (*
this)(0, 0) * (*
this)(1, 3) * (*
this)(2, 2) * (*
this)(3, 1)
424 - (*
this)(0, 1) * (*
this)(1, 0) * (*
this)(2, 2) * (*
this)(3, 3)
425 - (*
this)(0, 1) * (*
this)(1, 2) * (*
this)(2, 3) * (*
this)(3, 0)
426 - (*
this)(0, 1) * (*
this)(1, 3) * (*
this)(2, 0) * (*
this)(3, 2)
428 - (*
this)(0, 2) * (*
this)(1, 0) * (*
this)(2, 3) * (*
this)(3, 1)
429 - (*
this)(0, 2) * (*
this)(1, 1) * (*
this)(2, 0) * (*
this)(3, 3)
430 - (*
this)(0, 2) * (*
this)(1, 3) * (*
this)(2, 1) * (*
this)(3, 0)
432 - (*
this)(0, 3) * (*
this)(1, 0) * (*
this)(2, 1) * (*
this)(3, 2)
433 - (*
this)(0, 3) * (*
this)(1, 1) * (*
this)(2, 2) * (*
this)(3, 0)
434 - (*
this)(0, 3) * (*
this)(1, 2) * (*
this)(2, 0) * (*
this)(3, 1)
438 template <u
int8_t Rows, u
int8_t Columns,
typename T>
439 #if defined(LUG_COMPILER_MSVC) 440 template <
typename,
typename,
typename,
typename,
typename>
443 template <
bool EnableBool>
447 static_assert(Rows == Columns,
"The matrix has to be a square matrix to calculate the determinant");
450 Matrix<Rows - 1, Columns - 1, T> minorMatrix(0);
452 constexpr uint8_t k = 0;
453 for (uint8_t i = 0; i < Rows; ++i) {
454 for (uint8_t row = 0; row < Rows; ++row) {
459 const uint8_t indexRow = row + (row > k ? -1 : 0);
460 for (uint8_t column = 0; column < Columns; ++column) {
465 const uint8_t indexColumn = column + (column > i ? -1 : 0);
466 minorMatrix(indexRow, indexColumn) = (*this)(row, column);
470 determinant += (*this)(i, k) * ((i + k) % 2 ? 1 : -1) * minorMatrix.det();
477 template <u
int8_t Rows, u
int8_t Columns,
typename T>
478 #if defined(LUG_COMPILER_MSVC) 482 template <
bool EnableBool>
486 static_assert(Rows == Columns,
"The identity matrix has to be a square matrix");
490 for (uint8_t i = 0; i < Rows; ++i) {
498 template <u
int8_t Rows, u
int8_t Columns,
typename T>
499 Matrix<Rows, Columns, T>
operator-(
const Matrix<Rows, Columns, T>& lhs) {
504 template <u
int8_t Rows, u
int8_t Columns,
typename T>
505 inline Matrix<Rows, Columns, T>
operator+(
const Matrix<Rows, Columns, T>& lhs, T rhs) {
506 return Matrix<Rows, Columns, T>(lhs.getValues() + rhs);
509 template <u
int8_t Rows, u
int8_t Columns,
typename T>
510 inline Matrix<Rows, Columns, T>
operator-(
const Matrix<Rows, Columns, T>& lhs, T rhs) {
511 return Matrix<Rows, Columns, T>(lhs.getValues() - rhs);
514 template <u
int8_t Rows, u
int8_t Columns,
typename T>
515 inline Matrix<Rows, Columns, T>
operator*(
const Matrix<Rows, Columns, T>& lhs, T rhs) {
516 return Matrix<Rows, Columns, T>(lhs.getValues() * rhs);
519 template <u
int8_t Rows, u
int8_t Columns,
typename T>
520 inline Matrix<Rows, Columns, T>
operator/(
const Matrix<Rows, Columns, T>& lhs, T rhs) {
521 return Matrix<Rows, Columns, T>(lhs.getValues() / rhs);
524 template <u
int8_t Rows, u
int8_t Columns,
typename T>
525 inline Matrix<Rows, Columns, T>
operator+(T lhs,
const Matrix<Rows, Columns, T>& rhs) {
526 return Matrix<Rows, Columns, T>(lhs + rhs.getValues());
529 template <u
int8_t Rows, u
int8_t Columns,
typename T>
530 inline Matrix<Rows, Columns, T>
operator-(T lhs,
const Matrix<Rows, Columns, T>& rhs) {
531 return Matrix<Rows, Columns, T>(lhs - rhs.getValues());
534 template <u
int8_t Rows, u
int8_t Columns,
typename T>
535 inline Matrix<Rows, Columns, T>
operator*(T lhs,
const Matrix<Rows, Columns, T>& rhs) {
536 return Matrix<Rows, Columns, T>(lhs * rhs.getValues());
539 template <u
int8_t Rows, u
int8_t Columns,
typename T>
540 inline Matrix<Rows, Columns, T>
operator/(T lhs,
const Matrix<Rows, Columns, T>& rhs) {
541 return Matrix<Rows, Columns, T>(lhs / rhs.getValues());
545 template <u
int8_t Rows, u
int8_t Columns,
typename T>
546 inline Matrix<Rows, Columns, T>
operator+(
const Matrix<Rows, Columns, T>& lhs,
const Matrix<Rows, Columns, T>& rhs) {
547 Matrix<Rows, Columns, T> matrix{lhs};
554 template <u
int8_t Rows, u
int8_t Columns,
typename T>
555 inline Matrix<Rows, Columns, T>
operator-(
const Matrix<Rows, Columns, T>& lhs,
const Matrix<Rows, Columns, T>& rhs) {
556 Matrix<Rows, Columns, T> matrix{lhs};
563 template <u
int8_t RowsLeft, u
int8_t ColumnsLeft, u
int8_t RowsRight, u
int8_t ColumnsRight,
typename T>
564 inline Matrix<RowsLeft, ColumnsRight, T>
operator*(
const Matrix<RowsLeft, ColumnsLeft, T>& lhs,
const Matrix<RowsRight, ColumnsRight, T>& rhs) {
565 static_assert(ColumnsLeft == RowsRight,
"Columns of the right operand and Rows of the left operand must be of the same size to multiply matrices");
567 Matrix<RowsLeft, ColumnsRight, T> matrix(0);
569 for (uint8_t i = 0; i < RowsLeft; ++i) {
570 for (uint8_t j = 0; j < ColumnsRight; ++j) {
571 for (uint8_t k = 0; k < RowsRight; ++k) {
572 matrix(i, j) += lhs(i, k) * rhs(k, j);
580 template <u
int8_t RowsLeft, u
int8_t ColumnsLeft, u
int8_t RowsRight, u
int8_t ColumnsRight,
typename T>
581 inline Matrix<RowsLeft, ColumnsRight, T>
operator/(
const Matrix<RowsLeft, ColumnsLeft, T>& lhs,
const Matrix<RowsRight, ColumnsRight, T>& rhs) {
582 static_assert(RowsLeft == ColumnsLeft,
"Matrix division can only happen with square matrix");
583 static_assert(RowsRight == ColumnsRight,
"Matrix division can only happen with square matrix");
584 static_assert(RowsLeft == RowsRight,
"Matrix division can only happen with matrices of the same size");
586 return lhs * rhs.inverse();
591 template <u
int8_t Rows, u
int8_t Columns,
typename T>
592 inline bool operator==(
const Matrix<Rows, Columns, T>& lhs,
const Matrix<Rows, Columns, T>& rhs) {
593 return (lhs.getValues() == rhs.getValues());
596 template <u
int8_t Rows, u
int8_t Columns,
typename T>
597 inline bool operator!=(
const Matrix<Rows, Columns, T>& lhs,
const Matrix<Rows, Columns, T>& rhs) {
598 return (lhs.getValues() != rhs.getValues());
602 template <u
int8_t Rows, u
int8_t Columns,
typename T>
603 std::ostream& operator<<(std::ostream& os, const Matrix<Rows, Columns, T>& matrix) {
606 for (uint8_t i = 0; i < Rows; ++i) {
609 for (uint8_t j = 0; j < Columns; ++j) {
Quaternion< T > inverse(const Quaternion< T > &lhs)
#define LUG_ASSERT(assertion, message)
bool operator!=(const Matrix< Rows, Columns, T > &lhs, const Matrix< Rows, Columns, T > &rhs)
bool operator==(const Matrix< Rows, Columns, T > &lhs, const Matrix< Rows, Columns, T > &rhs)
Matrix< Rows, Columns, T > operator-(const Matrix< Rows, Columns, T > &lhs)
Matrix< Rows, Columns, T > operator*(const Matrix< Rows, Columns, T > &lhs, T rhs)
std::enable_if<(Rows==1) &&EnableBool, Matrix< Rows, Columns, T > >::type inverse() const
Matrix< Rows, Columns, T > operator/(const Matrix< Rows, Columns, T > &lhs, T rhs)
Matrix< Rows, Columns, T > operator+(const Matrix< Rows, Columns, T > &lhs, T rhs)