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 explicit 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&) = default;
352
354
356
358
359 void Fill(const T& val);
360
361 void Fill(const std::function<T(size_t i)>& func);
362
363 void Fill(const std::function<T(size_t i, size_t j)>& func);
364
365 void Swap(Matrix& other);
366
367 [[nodiscard]] constexpr size_t GetRows() const;
368
369 [[nodiscard]] constexpr size_t GetCols() const;
370
371 [[nodiscard]] Iterator begin();
372
374
375 [[nodiscard]] Iterator end();
376
378
379 [[nodiscard]] Pointer data();
380
382
383 Reference operator[](size_t i);
384
385 ConstReference operator[](size_t i) const;
386
387 constexpr static Matrix MakeUnitX();
388
389 constexpr static Matrix MakeUnitY();
390
391 constexpr static Matrix MakeUnitZ();
392
393 constexpr static Matrix MakeUnit(size_t i);
394
398};
399
402 public MatrixDenseBase<T, 4, 1, Matrix<T, 4, 1>>
403{
404 public:
406 using Base::operator();
407
408 using ValueType = T;
409 using Reference = T&;
410 using ConstReference = const T&;
411 using Pointer = T*;
412 using ConstPointer = const T*;
415
416 constexpr Matrix() : x(T{}), y(T{}), z(T{}), w(T{})
417 {
418 // Do nothing
419 }
420
421 constexpr Matrix(const T& _x, const T& _y, const T& _z, const T& _w)
422 : x(_x), y(_y), z(_z), w(_w)
423 {
424 // Do nothing
425 }
426
427 template <size_t R, size_t C, typename E>
429
430 Matrix(const std::initializer_list<T>& lst);
431
432 ~Matrix() = default;
433
434 constexpr Matrix(const Matrix& other)
435 : x(other.x), y(other.y), z(other.z), w(other.w)
436 {
437 // Do nothing
438 }
439
441 : x(std::move(other.x)),
442 y(std::move(other.y)),
443 z(std::move(other.z)),
444 w(std::move(other.w))
445 {
446 // Do nothing
447 }
448
450 {
451 x = other.x;
452 y = other.y;
453 z = other.z;
454 w = other.w;
455 return *this;
456 }
457
459 {
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 return *this;
465 }
466
467 void Fill(const T& val);
468
469 void Fill(const std::function<T(size_t i)>& func);
470
471 void Fill(const std::function<T(size_t i, size_t j)>& func);
472
473 void Swap(Matrix& other);
474
475 [[nodiscard]] constexpr size_t GetRows() const;
476
477 [[nodiscard]] constexpr size_t GetCols() const;
478
479 [[nodiscard]] Iterator begin();
480
481 [[nodiscard]] constexpr ConstIterator begin() const;
482
483 [[nodiscard]] Iterator end();
484
485 [[nodiscard]] constexpr ConstIterator end() const;
486
487 [[nodiscard]] Pointer data();
488
489 [[nodiscard]] constexpr ConstPointer data() const;
490
491 Reference operator[](size_t i);
492
493 ConstReference operator[](size_t i) const;
494
495 constexpr static Matrix MakeUnitX();
496
497 constexpr static Matrix MakeUnitY();
498
499 constexpr static Matrix MakeUnitZ();
500
501 constexpr static Matrix MakeUnitW();
502
503 constexpr static Matrix MakeUnit(size_t i);
504
509};
510
511template <typename T>
512class Matrix<T, MATRIX_SIZE_DYNAMIC, MATRIX_SIZE_DYNAMIC> final
513 : public MatrixExpression<
514 T, MATRIX_SIZE_DYNAMIC, MATRIX_SIZE_DYNAMIC,
515 Matrix<T, MATRIX_SIZE_DYNAMIC, MATRIX_SIZE_DYNAMIC>>,
516 public MatrixDenseBase<
517 T, MATRIX_SIZE_DYNAMIC, MATRIX_SIZE_DYNAMIC,
518 Matrix<T, MATRIX_SIZE_DYNAMIC, MATRIX_SIZE_DYNAMIC>>
519{
520 public:
521 using ValueType = T;
522 using Reference = T&;
523 using ConstReference = const T&;
524 using Pointer = T*;
525 using ConstPointer = const T*;
528 using MatrixDenseBase<
529 T, MATRIX_SIZE_DYNAMIC, MATRIX_SIZE_DYNAMIC,
531
533
534 Matrix(size_t rows, size_t cols, ConstReference value = ValueType{});
535
536 template <size_t R, size_t C, typename E>
538
540
541 explicit Matrix(size_t rows, size_t cols, ConstPointer ptr);
542
543 ~Matrix() = default;
544
545 Matrix(const Matrix& other);
546
547 Matrix(Matrix&& other) noexcept;
548
549 Matrix& operator=(const Matrix& other);
550
551 Matrix& operator=(Matrix&& other) noexcept;
552
553 void Fill(const T& val);
554
555 void Fill(const std::function<T(size_t i)>& func);
556
557 void Fill(const std::function<T(size_t i, size_t j)>& func);
558
559 void Swap(Matrix& other);
560
561 void Resize(size_t rows, size_t cols, ConstReference val = ValueType{});
562
563 void Clear();
564
565 [[nodiscard]] size_t GetRows() const;
566
567 [[nodiscard]] size_t GetCols() const;
568
569 [[nodiscard]] Iterator begin();
570
571 [[nodiscard]] ConstIterator begin() const;
572
573 [[nodiscard]] Iterator end();
574
575 [[nodiscard]] ConstIterator end() const;
576
577 [[nodiscard]] Pointer data();
578
579 [[nodiscard]] ConstPointer data() const;
580
581 Reference operator[](size_t i);
582
583 ConstReference operator[](size_t i) const;
584
585 private:
586 std::vector<T> m_elements;
587 size_t m_rows = 0;
588 size_t m_cols = 0;
589};
590
591template <typename T>
592class Matrix<T, MATRIX_SIZE_DYNAMIC, 1> final
593 : public MatrixExpression<T, MATRIX_SIZE_DYNAMIC, 1,
594 Matrix<T, MATRIX_SIZE_DYNAMIC, 1>>,
595 public MatrixDenseBase<T, MATRIX_SIZE_DYNAMIC, 1,
596 Matrix<T, MATRIX_SIZE_DYNAMIC, 1>>
597{
598 public:
599 using ValueType = T;
600 using Reference = T&;
601 using ConstReference = const T&;
602 using Pointer = T*;
603 using ConstPointer = const T*;
606 using MatrixDenseBase<T, MATRIX_SIZE_DYNAMIC, 1,
608
610
611 explicit Matrix(size_t rows, ConstReference value = ValueType{});
612
613 template <size_t R, size_t C, typename E>
615
616 Matrix(const std::initializer_list<T>& lst);
617
618 explicit Matrix(size_t rows, ConstPointer ptr);
619
620 ~Matrix() = default;
621
622 Matrix(const Matrix& other);
623
624 Matrix(Matrix&& other) noexcept;
625
626 Matrix& operator=(const Matrix& other);
627
628 Matrix& operator=(Matrix&& other) noexcept;
629
630 void Fill(const T& val);
631
632 void Fill(const std::function<T(size_t i)>& func);
633
634 void Fill(const std::function<T(size_t i, size_t j)>& func);
635
636 void Swap(Matrix& other);
637
638 void Resize(size_t rows, ConstReference val = ValueType{});
639
640 void AddElement(ConstReference newElem);
641
642 void AddElement(const Matrix& newElems);
643
644 void Clear();
645
646 [[nodiscard]] size_t GetRows() const;
647
648 [[nodiscard]] constexpr size_t GetCols() const;
649
650 [[nodiscard]] Iterator begin();
651
652 [[nodiscard]] ConstIterator begin() const;
653
654 [[nodiscard]] Iterator end();
655
656 [[nodiscard]] ConstIterator end() const;
657
658 [[nodiscard]] Pointer data();
659
660 [[nodiscard]] ConstPointer data() const;
661
662 Reference operator[](size_t i);
663
664 ConstReference operator[](size_t i) const;
665
666 private:
667 std::vector<T> m_elements;
668};
669
670template <typename T>
672
673template <typename T>
675
676template <typename T>
678
691
704
717
718template <typename T, size_t Rows>
720
721template <typename T>
723
724template <typename T>
726
727template <typename T>
729
730template <typename T>
732
745
758
771
784
785template <typename T>
787
800
801template <typename T>
803
816
817template <typename T, size_t Rows, size_t Cols>
819{
820 using value = T;
821};
822
823template <typename T, size_t R1, size_t C1, size_t R2, size_t C2, typename M2>
825
826template <typename T, size_t Rows, size_t Cols>
827void operator+=(Matrix<T, Rows, Cols>& a, const T& b);
828
829template <typename T, size_t R1, size_t C1, size_t R2, size_t C2, typename M2>
831
832template <typename T, size_t Rows, size_t Cols>
833void operator-=(Matrix<T, Rows, Cols>& a, const T& b);
834
835template <typename T, size_t R1, size_t C1, size_t R2, size_t C2, typename M2>
837
838template <typename T, size_t R1, size_t C1, size_t R2, size_t C2, typename M2>
840
841template <typename T, size_t Rows, size_t Cols>
842void operator*=(Matrix<T, Rows, Cols>& a, const T& b);
843
844template <typename T, size_t R1, size_t C1, size_t R2, size_t C2, typename M2>
846
847template <typename T, size_t Rows, size_t Cols>
848void operator/=(Matrix<T, Rows, Cols>& a, const T& b);
849
850template <typename T, size_t Rows, size_t Cols, typename M1, typename M2>
851constexpr std::enable_if_t<IsMatrixSizeStatic<Rows, Cols>(), bool> operator==(
854
855template <typename T, size_t R1, size_t C1, size_t R2, size_t C2, typename M1,
856 typename M2>
859
860template <typename T, size_t R1, size_t C1, size_t R2, size_t C2, typename M1,
861 typename M2>
864
865template <typename T, size_t Rows, size_t Cols, typename M1,
866 typename BinaryOperation>
867constexpr std::enable_if_t<TraitIsMatrixSizeStatic<Rows, Cols>::value, T>
870
871template <typename T, size_t Rows, size_t Cols, typename M1>
872constexpr std::enable_if_t<TraitIsMatrixSizeStatic<Rows, Cols>::value, T>
874
875template <typename T, size_t Rows, size_t Cols, typename M1>
876constexpr std::enable_if_t<TraitIsMatrixSizeStatic<Rows, Cols>::value, T>
878
879template <typename T, size_t Rows, size_t Cols, typename M1,
880 typename BinaryOperation>
881constexpr std::enable_if_t<TraitIsMatrixSizeDynamic<Rows, Cols>::value, T>
884
885template <typename T, size_t Rows, size_t Cols, typename M1>
886constexpr std::enable_if_t<TraitIsMatrixSizeDynamic<Rows, Cols>::value, T>
888
889template <typename T, size_t Rows, size_t Cols, typename M1>
890constexpr std::enable_if_t<TraitIsMatrixSizeDynamic<Rows, Cols>::value, T>
892
893template <typename T, size_t Rows, size_t Cols, typename M1>
895 const T& init);
896
897template <typename T, size_t Rows, size_t Cols, typename M1, typename M2,
898 typename M3, typename M4>
899std::enable_if_t<IsMatrixSizeStatic<Rows, Cols>(), Matrix<T, Rows, Cols>>
904} // namespace CubbyFlow
905
907
908#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
constexpr Matrix()
Definition Matrix.hpp:327
constexpr Matrix(const T &_x, const T &_y, const T &_z)
Definition Matrix.hpp:338
constexpr Matrix(const Matrix &)=default
constexpr Matrix(const Matrix< T, 2, 1 > &_xy, const T &_z)
Definition Matrix.hpp:332
constexpr Matrix(Matrix &&) noexcept=default
Matrix & operator=(const Matrix &other)
Definition Matrix.hpp:449
ValueType z
Definition Matrix.hpp:507
constexpr Matrix(const T &_x, const T &_y, const T &_z, const T &_w)
Definition Matrix.hpp:421
constexpr Matrix(const Matrix &other)
Definition Matrix.hpp:434
constexpr Matrix(Matrix &&other) noexcept
Definition Matrix.hpp:440
constexpr Matrix()
Definition Matrix.hpp:416
Matrix & operator=(Matrix &&other) noexcept
Definition Matrix.hpp:458
ValueType x
Definition Matrix.hpp:505
ValueType w
Definition Matrix.hpp:508
ValueType y
Definition Matrix.hpp:506
const T & ConstReference
Definition Matrix.hpp:601
const T * ConstPointer
Definition Matrix.hpp:603
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:22
void ElemIDiv(Matrix< T, R1, C1 > &a, const MatrixExpression< T, R2, C2, M2 > &b)
Definition Matrix-Impl.hpp:1387
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:132
void ElemIMul(Matrix< T, R1, C1 > &a, const MatrixExpression< T, R2, C2, M2 > &b)
Definition Matrix-Impl.hpp:1369
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:1402
constexpr T Product(const MatrixExpression< T, Rows, Cols, M1 > &a, const T &init)
Definition Matrix-Impl.hpp:1499
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:719
bool operator!=(const MatrixExpression< T, R1, C1, M1 > &a, const MatrixExpression< T, R2, C2, M2 > &b)
Definition Matrix-Impl.hpp:1437
void operator+=(Matrix< T, R1, C1 > &a, const MatrixExpression< T, R2, C2, M2 > &b)
Definition Matrix-Impl.hpp:1336
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:1446
void operator*=(Matrix< T, R1, C1 > &a, const MatrixExpression< T, R2, C2, M2 > &b)
Definition Matrix-Impl.hpp:1360
void operator/=(Matrix< T, Rows, Cols > &a, const T &b)
Definition Matrix-Impl.hpp:1394
void operator-=(Matrix< T, R1, C1 > &a, const MatrixExpression< T, R2, C2, M2 > &b)
Definition Matrix-Impl.hpp:1348
Returns the type of the value itself.
Definition TypeHelpers.hpp:19