diff options
Diffstat (limited to 'src/lib/mathlib/math/Matrix.hpp')
-rw-r--r-- | src/lib/mathlib/math/Matrix.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/mathlib/math/Matrix.hpp b/src/lib/mathlib/math/Matrix.hpp index f6f4fc5ea..2a7b61238 100644 --- a/src/lib/mathlib/math/Matrix.hpp +++ b/src/lib/mathlib/math/Matrix.hpp @@ -136,6 +136,24 @@ public: #endif /** + * set row from vector + */ + void set_row(unsigned int row, const Vector<N> v) { + for (unsigned i = 0; i < N; i++) { + data[row][i] = v.data[i]; + } + } + + /** + * set column from vector + */ + void set_col(unsigned int col, const Vector<M> v) { + for (unsigned i = 0; i < M; i++) { + data[i][col] = v.data[i]; + } + } + + /** * access by index */ float &operator()(const unsigned int row, const unsigned int col) { |