aboutsummaryrefslogtreecommitdiff
path: root/src/lib/mathlib/math/Matrix.hpp
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2015-04-12 01:47:48 +0200
committerAnton Babushkin <anton.babushkin@me.com>2015-04-12 01:47:48 +0200
commitdc2bb2a85ea4d2a840306cafa6aa4e217ee4dbe9 (patch)
tree965e2902540f20668500e166010d9a725ac946bb /src/lib/mathlib/math/Matrix.hpp
parentd4ae721bc0a96509cfbdb004bbe302694e143ee7 (diff)
downloadpx4-firmware-dc2bb2a85ea4d2a840306cafa6aa4e217ee4dbe9.tar.gz
px4-firmware-dc2bb2a85ea4d2a840306cafa6aa4e217ee4dbe9.tar.bz2
px4-firmware-dc2bb2a85ea4d2a840306cafa6aa4e217ee4dbe9.zip
attitude_estimator_q added
Diffstat (limited to 'src/lib/mathlib/math/Matrix.hpp')
-rw-r--r--src/lib/mathlib/math/Matrix.hpp18
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) {