Loading...
Searching...
No Matches
Matrix.hpp
Go to the documentation of this file.
1// This code is based on Jet framework.
2// Copyright (c) 2018 Doyub Kim
3// CubbyFlow is voxel-based fluid simulation engine for computer games.
4// Copyright (c) 2020 CubbyFlow Team
5// Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
6// AI Part: Dongheon Cho, Minseo Kim
7// We are making my contributions/submissions to this project solely in our
8// personal capacity and are not conveying any rights to any intellectual
9// property of any third parties.
10
11#ifndef CUBBYFLOW_MATRIX_HPP
12#define CUBBYFLOW_MATRIX_HPP
13
16#include <Core/Utils/Macros.hpp>
19
20#include <array>
21#include <cstdint>
22#include <vector>
23
24namespace CubbyFlow
25{
26template <typename T, size_t Rows, size_t Cols>
28 : public MatrixExpression<T, Rows, Cols, Matrix<T, Rows, Cols>>,
29 public MatrixDenseBase<T, Rows, Cols, Matrix<T, Rows, Cols>>
30{
31 public:
32 static_assert(IsMatrixSizeStatic<Rows, Cols>(),
33 "This class should be a static-sized matrix.");
34
36 using Base::CopyFrom;
37 using Base::operator();
38
39 using ValueType = T;
40 using Reference = T&;
41 using ConstReference = const T&;
42 using Pointer = T*;
43 using ConstPointer = const T*;
46
47 constexpr Matrix() : m_elements{}
48 {
49 // Do nothing
50 }
51
53
54 template <typename... Args>
56 : m_elements{ { first, static_cast<ValueType>(rest)... } }
57 {
58 // Do nothing
59 }
60
61 template <size_t R, size_t C, typename E>
63
65
66 Matrix(ConstPointer ptr);
67
68 ~Matrix() = default;
69
70 constexpr Matrix(const Matrix& other) : m_elements(other.m_elements)
71 {
72 // Do nothing
73 }
74
76 : m_elements(std::move(other.m_elements))
77 {
78 // Do nothing
79 }
80
82 {
83 m_elements = other.m_elements;
84 return *this;
85 }
86
88 {
89 m_elements = std::move(other.m_elements);
90 return *this;
91 }
92
93 void Fill(const T& val);
94
95 void Fill(const std::function<T(size_t i)>& func);
96
97 void Fill(const std::function<T(size_t i, size_t j)>& func);
98
99 void Swap(Matrix& other);
100
101 [[nodiscard]] constexpr size_t GetRows() const;
102
103 [[nodiscard]] constexpr size_t GetCols() const;
104
105 Iterator begin();
106
107 constexpr ConstIterator begin() const;
108
109 Iterator end();
110
111 constexpr ConstIterator end() const;
112
113 Pointer data();
114
115 constexpr ConstPointer data() const;
116
117 Reference operator[](size_t i);
118
119 ConstReference operator[](size_t i) const;
120
121 private:
122 std::array<T, Rows * Cols> m_elements;
123};
124
125template <typename T>
126class Matrix<T, 1, 1> final : public MatrixExpression<T, 1, 1, Matrix<T, 1, 1>>,
127 public MatrixDenseBase<T, 1, 1, Matrix<T, 1, 1>>
128{
129 public:
131 using Base::operator();
132
133 using ValueType = T;
134 using Reference = T&;
135 using ConstReference = const T&;
136 using Pointer = T*;
137 using ConstPointer = const T*;
140
141 constexpr Matrix() : x(T{})
142 {
143 // Do nothing
144 }
145
146 constexpr Matrix(const T& _x) : x(_x)
147 {
148 // Do nothing
149 }
150
151 template <size_t R, size_t C, typename E>
153
154 Matrix(const std::initializer_list<T>& lst);
155
156 ~Matrix() = default;
157
158 constexpr Matrix(const Matrix& other) : x(other.x)
159 {
160 // Do nothing
161 }
162
163 constexpr Matrix(Matrix&& other) noexcept : x(std::move(other.x))
164 {
165 // Do nothing
166 }
167
169 {
170 x = other.x;
171 return *this;
172 }
173
175 {
176 x = std::move(other.x);
177 return *this;
178 }
179
180 void Fill(const T& val);
181
182 void Fill(const std::function<T(size_t i)>& func);
183
184 void Fill(const std::function<T(size_t i, size_t j)>& func);
185
186 void Swap(Matrix& other);
187
188 [[nodiscard]] constexpr size_t GetRows() const;
189
190 [[nodiscard]] constexpr size_t GetCols() const;
191
192 [[nodiscard]] Iterator begin();
193
194 [[nodiscard]] constexpr ConstIterator begin() const;
195
196 [[nodiscard]] Iterator end();
197
198 [[nodiscard]] constexpr ConstIterator end() const;
199
200 [[nodiscard]] Pointer data();
201
202 [[nodiscard]] constexpr ConstPointer data() const;
203
204 Reference operator[](size_t i);
205
206 ConstReference operator[](size_t i) const;
207
208 constexpr static Matrix MakeUnitX();
209
210 constexpr static Matrix MakeUnit(size_t i);
211
213};
214
215template <typename T>
216class Matrix<T, 2, 1> final : public MatrixExpression<T, 2, 1, Matrix<T, 2, 1>>,
217 public MatrixDenseBase<T, 2, 1, Matrix<T, 2, 1>>
218{
219 public:
221 using Base::operator();
222
223 using ValueType = T;
224 using Reference = T&;
225 using ConstReference = const T&;
226 using Pointer = T*;
227 using ConstPointer = const T*;
230
231 constexpr Matrix() : x(T{}), y(T{})
232 {
233 // Do nothing
234 }
235
236 constexpr Matrix(const T& _x, const T& _y) : x(_x), y(_y)
237 {
238 // Do nothing
239 }
240
241 template <size_t R, size_t C, typename E>
243
244 Matrix(const std::initializer_list<T>& lst);
245
246 ~Matrix() = default;
247
248 constexpr Matrix(const Matrix& other) : x(other.x), y(other.y)
249 {
250 // Do nothing
251 }
252
254 : x(std::move(other.x)), y(std::move(other.y))
255 {
256 // Do nothing
257 }
258
260 {
261 x = other.x;
262 y = other.y;
263 return *this;
264 }
265
267 {
268 x = std::move(other.x);
269 y = std::move(other.y);
270 return *this;
271 }
272
273 void Fill(const T& val);
274
275 void Fill(const std::function<T(size_t i)>& func);
276
277 void Fill(const std::function<T(size_t i, size_t j)>& func);
278
279 void Swap(Matrix& other);
280
281 [[nodiscard]] constexpr size_t GetRows() const;
282
283 [[nodiscard]] constexpr size_t GetCols() const;
284
285 [[nodiscard]] Iterator begin();
286
287 [[nodiscard]] constexpr ConstIterator begin() const;
288
289 [[nodiscard]] Iterator end();
290
291 [[nodiscard]] constexpr ConstIterator end() const;
292
293 [[nodiscard]] Pointer data();
294
295 [[nodiscard]] constexpr ConstPointer data() const;
296
297 Reference operator[](size_t i);
298
299 ConstReference operator[](size_t i) const;
300
301 constexpr static Matrix MakeUnitX();
302
303 constexpr static Matrix MakeUnitY();
304
305 constexpr static Matrix MakeUnit(size_t i);
306
309};
310
311template <typename T>
312class Matrix<T, 3, 1> final : public MatrixExpression<T, 3, 1, Matrix<T, 3, 1>>,
313 public MatrixDenseBase<T, 3, 1, Matrix<T, 3, 1>>
314{
315 public:
317 using Base::operator();
318
319 using ValueType = T;
320 using Reference = T&;
321 using ConstReference = const T&;
322 using Pointer = T*;
323 using ConstPointer = const T*;
326
327 constexpr Matrix() : x(T{}), y(T{}), z(T{})
328 {
329 // Do nothing
330 }
331
332 constexpr Matrix(const Matrix<T, 2, 1>& _xy, const T& _z)
333 : x(_xy.x), y(_xy.y), z(_z)
334 {
335 // Do nothing
336 }
337
338 constexpr Matrix(const T& _x, const T& _y, const T& _z)
339 : x(_x), y(_y), z(_z)
340 {
341 // Do nothing
342 }
343
344 template <size_t R, size_t C, typename E>
346
347 Matrix(const std::initializer_list<T>& lst);
348
349 ~Matrix() = default;
350
351 constexpr Matrix(const Matrix& other) : x(other.x), y(other.y), z(other.z)
352 {
353 // Do nothing
354 }
355
357 : x(std::move(other.x)), y(std::move(other.y)), z(std::move(other.z))
358 {
359 // Do nothing
360 }
361
363 {
364 x = other.x;
365 y = other.y;
366 z = other.z;
367 return *this;
368 }
369
371 {
372 x = std::move(other.x);
373 y = std::move(other.y);
374 z = std::move(other.z);
375 return *this;
376 }
377
378 void Fill(const T& val);
379
380 void Fill(const std::function<T(size_t i)>& func);
381
382 void Fill(const std::function<T(size_t i, size_t j)>& func);
383
384 void Swap(Matrix& other);
385
386 [[nodiscard]] constexpr size_t GetRows() const;
387
388 [[nodiscard]] constexpr size_t GetCols() const;
389
390 [[nodiscard]] Iterator begin();
391
392 [[nodiscard]] constexpr ConstIterator begin() const;
393
394 [[nodiscard]] Iterator end();
395
396 [[nodiscard]] constexpr ConstIterator end() const;
397
398 [[nodiscard]] Pointer data();
399
400 [[nodiscard]] constexpr ConstPointer data() const;
401
402 Reference operator[](size_t i);
403
404 ConstReference operator[](size_t i) const;
405
406 constexpr static Matrix MakeUnitX();
407
408 constexpr static Matrix MakeUnitY();
409
410 constexpr static Matrix MakeUnitZ();
411
412 constexpr static Matrix MakeUnit(size_t i);
413
417};
418
419template <typename T>
420class Matrix<T, 4, 1> final : public MatrixExpression<T, 4, 1, Matrix<T, 4, 1>>,
421 public MatrixDenseBase<T, 4, 1, Matrix<T, 4, 1>>
422{
423 public:
425 using Base::operator();
426
427 using ValueType = T;
428 using Reference = T&;
429 using ConstReference = const T&;
430 using Pointer = T*;
431 using ConstPointer = const T*;
434
435 constexpr Matrix() : x(T{}), y(T{}), z(T{}), w(T{})
436 {
437 // Do nothing
438 }
439
440 constexpr Matrix(const T& _x, const T& _y, const T& _z, const T& _w)
441 : x(_x), y(_y), z(_z), w(_w)
442 {
443 // Do nothing
444 }
445
446 template <size_t R, size_t C, typename E>
448
449 Matrix(const std::initializer_list<T>& lst);
450
451 ~Matrix() = default;
452
453 constexpr Matrix(const Matrix& other)
454 : x(other.x), y(other.y), z(other.z), w(other.w)
455 {
456 // Do nothing
457 }
458
460 : x(std::move(other.x)),
461 y(std::move(other.y)),
462 z(std::move(other.z)),
463 w(std::move(other.w))
464 {
465 // Do nothing
466 }
467
469 {
470 x = other.x;
471 y = other.y;
472 z = other.z;
473 w = other.w;
474 return *this;
475 }
476
478 {
479 x = std::move(other.x);
480 y = std::move(other.y);
481 z = std::move(other.z);
482 w = std::move(other.w);
483 return *this;
484 }
485
486 void Fill(const T& val);
487
488 void Fill(const std::function<T(size_t i)>& func);
489
490 void Fill(const std::function<T(size_t i, size_t j)>& func);
491
492 void Swap(Matrix& other);
493
494 [[nodiscard]] constexpr size_t GetRows() const;
495
496 [[nodiscard]] constexpr size_t GetCols() const;
497
498 [[nodiscard]] Iterator begin();
499
500 [[nodiscard]] constexpr ConstIterator begin() const;
501
502 [[nodiscard]] Iterator end();
503
504 [[nodiscard]] constexpr ConstIterator end() const;
505
506 [[nodiscard]] Pointer data();
507
508 [[nodiscard]] constexpr ConstPointer data() const;
509
510 Reference operator[](size_t i);
511
512 ConstReference operator[](size_t i) const;
513
514 constexpr static Matrix MakeUnitX();
515
516 constexpr static Matrix MakeUnitY();
517
518 constexpr static Matrix MakeUnitZ();
519
520 constexpr static Matrix MakeUnitW();
521
522 constexpr static Matrix MakeUnit(size_t i);
523
528};
529
530template <typename T>
531class Matrix<T, MATRIX_SIZE_DYNAMIC, MATRIX_SIZE_DYNAMIC> final
532 : public MatrixExpression<
533 T, MATRIX_SIZE_DYNAMIC, MATRIX_SIZE_DYNAMIC,
534 Matrix<T, MATRIX_SIZE_DYNAMIC, MATRIX_SIZE_DYNAMIC>>,
535 public MatrixDenseBase<
536 T, MATRIX_SIZE_DYNAMIC, MATRIX_SIZE_DYNAMIC,
537 Matrix<T, MATRIX_SIZE_DYNAMIC, MATRIX_SIZE_DYNAMIC>>
538{
539 public:
540 using ValueType = T;
541 using Reference = T&;
542 using ConstReference = const T&;
543 using Pointer = T*;
544 using ConstPointer = const T*;
547 using MatrixDenseBase<
548 T, MATRIX_SIZE_DYNAMIC, MATRIX_SIZE_DYNAMIC,
550
551 Matrix();
552
553 Matrix(size_t rows, size_t cols, ConstReference value = ValueType{});
554
555 template <size_t R, size_t C, typename E>
557
559
560 explicit Matrix(size_t rows, size_t cols, ConstPointer ptr);
561
562 ~Matrix() = default;
563
564 Matrix(const Matrix& other);
565
566 Matrix(Matrix&& other) noexcept;
567
568 Matrix& operator=(const Matrix& other);
569
570 Matrix& operator=(Matrix&& other) noexcept;
571
572 void Fill(const T& val);
573
574 void Fill(const std::function<T(size_t i)>& func);
575
576 void Fill(const std::function<T(size_t i, size_t j)>& func);
577
578 void Swap(Matrix& other);
579
580 void Resize(size_t rows, size_t cols, ConstReference val = ValueType{});
581
582 void Clear();
583
584 [[nodiscard]] size_t GetRows() const;
585
586 [[nodiscard]] size_t GetCols() const;
587
588 [[nodiscard]] Iterator begin();
589
590 [[nodiscard]] ConstIterator begin() const;
591
592 [[nodiscard]] Iterator end();
593
594 [[nodiscard]] ConstIterator end() const;
595
596 [[nodiscard]] Pointer data();
597
598 [[nodiscard]] ConstPointer data() const;
599
600 Reference operator[](size_t i);
601
602 ConstReference operator[](size_t i) const;
603
604 private:
605 std::vector<T> m_elements;
606 size_t m_rows = 0;
607 size_t m_cols = 0;
608};
609
610template <typename T>
611class Matrix<T, MATRIX_SIZE_DYNAMIC, 1> final
612 : public MatrixExpression<T, MATRIX_SIZE_DYNAMIC, 1,
613 Matrix<T, MATRIX_SIZE_DYNAMIC, 1>>,
614 public MatrixDenseBase<T, MATRIX_SIZE_DYNAMIC, 1,
615 Matrix<T, MATRIX_SIZE_DYNAMIC, 1>>
616{
617 public:
618 using ValueType = T;
619 using Reference = T&;
620 using ConstReference = const T&;
621 using Pointer = T*;
622 using ConstPointer = const T*;
625 using MatrixDenseBase<T, MATRIX_SIZE_DYNAMIC, 1,
627
628 Matrix();
629
630 Matrix(size_t rows, ConstReference value = ValueType{});
631
632 template <size_t R, size_t C, typename E>
634
635 Matrix(const std::initializer_list<T>& lst);
636
637 explicit Matrix(size_t rows, ConstPointer ptr);
638
639 ~Matrix() = default;
640
641 Matrix(const Matrix& other);
642
643 Matrix(Matrix&& other) noexcept;
644
645 Matrix& operator=(const Matrix& other);
646
647 Matrix& operator=(Matrix&& other) noexcept;
648
649 void Fill(const T& val);
650
651 void Fill(const std::function<T(size_t i)>& func);
652
653 void Fill(const std::function<T(size_t i, size_t j)>& func);
654
655 void Swap(Matrix& other);
656
657 void Resize(size_t rows, ConstReference val = ValueType{});
658
659 void AddElement(ConstReference newElem);
660
661 void AddElement(const Matrix& newElems);
662
663 void Clear();
664
665 [[nodiscard]] size_t GetRows() const;
666
667 [[nodiscard]] constexpr size_t GetCols() const;
668
669 [[nodiscard]] Iterator begin();
670
671 [[nodiscard]] ConstIterator begin() const;
672
673 [[nodiscard]] Iterator end();
674
675 [[nodiscard]] ConstIterator end() const;
676
677 [[nodiscard]] Pointer data();
678
679 [[nodiscard]] ConstPointer data() const;
680
681 Reference operator[](size_t i);
682
683 ConstReference operator[](size_t i) const;
684
685 private:
686 std::vector<T> m_elements;
687};
688
689template <typename T>
691
692template <typename T>
694
695template <typename T>
697
710
723
736
737template <typename T, size_t Rows>
739
740template <typename T>
742
743template <typename T>
745
746template <typename T>
748
749template <typename T>
751
764
777
790
803
804template <typename T>
806
819
820template <typename T>
822
835
836template <typename T, size_t Rows, size_t Cols>
838{
839 using value = T;
840};
841
842template <typename T, size_t R1, size_t C1, size_t R2, size_t C2, typename M2>
844
845template <typename T, size_t Rows, size_t Cols>
846void operator+=(Matrix<T, Rows, Cols>& a, const T& b);
847
848template <typename T, size_t R1, size_t C1, size_t R2, size_t C2, typename M2>
850
851template <typename T, size_t Rows, size_t Cols>
852void operator-=(Matrix<T, Rows, Cols>& a, const T& b);
853
854template <typename T, size_t R1, size_t C1, size_t R2, size_t C2, typename M2>
856
857template <typename T, size_t R1, size_t C1, size_t R2, size_t C2, typename M2>
859
860template <typename T, size_t Rows, size_t Cols>
861void operator*=(Matrix<T, Rows, Cols>& a, const T& b);
862
863template <typename T, size_t R1, size_t C1, size_t R2, size_t C2, typename M2>
865
866template <typename T, size_t Rows, size_t Cols>
867void operator/=(Matrix<T, Rows, Cols>& a, const T& b);
868
869template <typename T, size_t Rows, size_t Cols, typename M1, typename M2>
870constexpr std::enable_if_t<IsMatrixSizeStatic<Rows, Cols>(), bool> operator==(
873
874template <typename T, size_t R1, size_t C1, size_t R2, size_t C2, typename M1,
875 typename M2>
878
879template <typename T, size_t R1, size_t C1, size_t R2, size_t C2, typename M1,
880 typename M2>
883
884template <typename T, size_t Rows, size_t Cols, typename M1,
885 typename BinaryOperation>
886constexpr std::enable_if_t<TraitIsMatrixSizeStatic<Rows, Cols>::value, T>
889
890template <typename T, size_t Rows, size_t Cols, typename M1>
891constexpr std::enable_if_t<TraitIsMatrixSizeStatic<Rows, Cols>::value, T>
893
894template <typename T, size_t Rows, size_t Cols, typename M1>
895constexpr std::enable_if_t<TraitIsMatrixSizeStatic<Rows, Cols>::value, T>
897
898template <typename T, size_t Rows, size_t Cols, typename M1,
899 typename BinaryOperation>
900constexpr std::enable_if_t<TraitIsMatrixSizeDynamic<Rows, Cols>::value, T>
903
904template <typename T, size_t Rows, size_t Cols, typename M1>
905constexpr std::enable_if_t<TraitIsMatrixSizeDynamic<Rows, Cols>::value, T>
907
908template <typename T, size_t Rows, size_t Cols, typename M1>
909constexpr std::enable_if_t<TraitIsMatrixSizeDynamic<Rows, Cols>::value, T>
911
912template <typename T, size_t Rows, size_t Cols, typename M1>
914 const T& init);
915
916template <typename T, size_t Rows, size_t Cols, typename M1, typename M2,
917 typename M3, typename M4>
918std::enable_if_t<IsMatrixSizeStatic<Rows, Cols>(), Matrix<T, Rows, Cols>>
923} // namespace CubbyFlow
924
926
927#endif
constexpr Matrix(Matrix &&other) noexcept
Definition Matrix.hpp:163
Matrix & operator=(Matrix &&other) noexcept
Definition Matrix.hpp:174
constexpr Matrix(const T &_x)
Definition Matrix.hpp:146
Matrix & operator=(const Matrix &other)
Definition Matrix.hpp:168
constexpr Matrix()
Definition Matrix.hpp:141
ValueType x
Definition Matrix.hpp:212
constexpr Matrix(const Matrix &other)
Definition Matrix.hpp:158
Matrix & operator=(const Matrix &other)
Definition Matrix.hpp:259
constexpr Matrix(const Matrix &other)
Definition Matrix.hpp:248
constexpr Matrix(Matrix &&other) noexcept
Definition Matrix.hpp:253
constexpr Matrix()
Definition Matrix.hpp:231
constexpr Matrix(const T &_x, const T &_y)
Definition Matrix.hpp:236
ValueType x
Definition Matrix.hpp:307
Matrix & operator=(Matrix &&other) noexcept
Definition Matrix.hpp:266
ValueType y
Definition Matrix.hpp:308
Matrix & operator=(Matrix &&other) noexcept
Definition Matrix.hpp:370
ValueType z
Definition Matrix.hpp:416
constexpr Matrix()
Definition Matrix.hpp:327
constexpr Matrix(const Matrix &other)
Definition Matrix.hpp:351
constexpr Matrix(const T &_x, const T &_y, const T &_z)
Definition Matrix.hpp:338
ValueType y
Definition Matrix.hpp:415
constexpr Matrix(const Matrix< T, 2, 1 > &_xy, const T &_z)
Definition Matrix.hpp:332
ValueType x
Definition Matrix.hpp:414
constexpr Matrix(Matrix &&other) noexcept
Definition Matrix.hpp:356
Matrix & operator=(const Matrix &other)
Definition Matrix.hpp:362
Matrix & operator=(const Matrix &other)
Definition Matrix.hpp:468
ValueType z
Definition Matrix.hpp:526
constexpr Matrix(const T &_x, const T &_y, const T &_z, const T &_w)
Definition Matrix.hpp:440
constexpr Matrix(const Matrix &other)
Definition Matrix.hpp:453
constexpr Matrix(Matrix &&other) noexcept
Definition Matrix.hpp:459
constexpr Matrix()
Definition Matrix.hpp:435
Matrix & operator=(Matrix &&other) noexcept
Definition Matrix.hpp:477
ValueType x
Definition Matrix.hpp:524
ValueType w
Definition Matrix.hpp:527
ValueType y
Definition Matrix.hpp:525
const T & ConstReference
Definition Matrix.hpp:620
const T * ConstPointer
Definition Matrix.hpp:622
Definition MatrixDenseBase.hpp:21
void CopyFrom(const MatrixExpression< T, R, C, E > &expression)
Copies from generic expression.
Definition MatrixDenseBase-Impl.hpp:21
Base class for matrix expression.
Definition MatrixExpression.hpp:94
Definition Matrix.hpp:30
Matrix & operator=(Matrix &&other) noexcept
Definition Matrix.hpp:87
Matrix & operator=(const Matrix &other)
Definition Matrix.hpp:81
const T * ConstPointer
Definition Matrix.hpp:43
T * Pointer
Definition Matrix.hpp:42
constexpr Matrix(const Matrix &other)
Definition Matrix.hpp:70
constexpr Matrix()
Definition Matrix.hpp:47
constexpr Matrix(ConstReference first, Args... rest)
Definition Matrix.hpp:55
const T & ConstReference
Definition Matrix.hpp:41
constexpr Matrix(Matrix &&other) noexcept
Definition Matrix.hpp:75
Definition pybind11Utils.hpp:21
void ElemIDiv(Matrix< T, R1, C1 > &a, const MatrixExpression< T, R2, C2, M2 > &b)
Definition Matrix-Impl.hpp:1393
void Fill(ArrayView< T, N > a, const Vector< size_t, N > &begin, const Vector< size_t, N > &end, const T &val)
Definition ArrayUtils-Impl.hpp:19
void ElemIMul(Matrix< T, R1, C1 > &a, const MatrixExpression< T, R2, C2, M2 > &b)
Definition Matrix-Impl.hpp:1375
constexpr std::enable_if_t< IsMatrixSizeStatic< Rows, Cols >(), bool > operator==(const MatrixExpression< T, Rows, Cols, M1 > &a, const MatrixExpression< T, Rows, Cols, M2 > &b)
Definition Matrix-Impl.hpp:1408
constexpr T Product(const MatrixExpression< T, Rows, Cols, M1 > &a, const T &init)
Definition Matrix-Impl.hpp:1503
std::enable_if_t< std::is_arithmetic< T >::value, T > MonotonicCatmullRom(const T &f0, const T &f1, const T &f2, const T &f3, T t)
Computes monotonic Catmull-Rom interpolation.
Definition MathUtils-Impl.hpp:336
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:738
bool operator!=(const MatrixExpression< T, R1, C1, M1 > &a, const MatrixExpression< T, R2, C2, M2 > &b)
Definition Matrix-Impl.hpp:1443
void operator+=(Matrix< T, R1, C1 > &a, const MatrixExpression< T, R2, C2, M2 > &b)
Definition Matrix-Impl.hpp:1342
constexpr std::enable_if_t< TraitIsMatrixSizeStatic< Rows, Cols >::value, T > Accumulate(const MatrixExpression< T, Rows, Cols, M1 > &a, const T &init, BinaryOperation op)
Definition Matrix-Impl.hpp:1452
void operator*=(Matrix< T, R1, C1 > &a, const MatrixExpression< T, R2, C2, M2 > &b)
Definition Matrix-Impl.hpp:1366
void operator/=(Matrix< T, Rows, Cols > &a, const T &b)
Definition Matrix-Impl.hpp:1400
void operator-=(Matrix< T, R1, C1 > &a, const MatrixExpression< T, R2, C2, M2 > &b)
Definition Matrix-Impl.hpp:1354
Returns the type of the value itself.
Definition TypeHelpers.hpp:19