diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-07-15 07:37:17 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-07-15 07:37:17 +0200 |
commit | 61286451361c0e4547caf2385f56ee6cc8afffb1 (patch) | |
tree | 15fb61570abbf84d90fad23d6d9a33e8d24b2bac /src/lib/mathlib/math | |
parent | 1744bf6e123f7870055daddedddd2e911d18e335 (diff) | |
download | px4-firmware-61286451361c0e4547caf2385f56ee6cc8afffb1.tar.gz px4-firmware-61286451361c0e4547caf2385f56ee6cc8afffb1.tar.bz2 px4-firmware-61286451361c0e4547caf2385f56ee6cc8afffb1.zip |
mathlib: More C++ fixes
Diffstat (limited to 'src/lib/mathlib/math')
-rw-r--r-- | src/lib/mathlib/math/Matrix.hpp | 2 | ||||
-rw-r--r-- | src/lib/mathlib/math/Vector.hpp | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/mathlib/math/Matrix.hpp b/src/lib/mathlib/math/Matrix.hpp index c2109b479..ca931e2da 100644 --- a/src/lib/mathlib/math/Matrix.hpp +++ b/src/lib/mathlib/math/Matrix.hpp @@ -77,6 +77,8 @@ public: { } + virtual ~MatrixBase() {}; + /** * copyt ctor */ diff --git a/src/lib/mathlib/math/Vector.hpp b/src/lib/mathlib/math/Vector.hpp index 5017b7c79..0ddf77615 100644 --- a/src/lib/mathlib/math/Vector.hpp +++ b/src/lib/mathlib/math/Vector.hpp @@ -78,19 +78,23 @@ public: } + virtual ~VectorBase() {}; + /** * copy ctor */ - VectorBase(const VectorBase<N> &v) { - arm_col = {N, 1, &data[0]}; + VectorBase(const VectorBase<N> &v) : + arm_col{N, 1, &data[0]} + { memcpy(data, v.data, sizeof(data)); } /** * setting ctor */ - VectorBase(const float d[N]) { - arm_col = {N, 1, &data[0]}; + VectorBase(const float d[N]) : + arm_col{N, 1, &data[0]} + { memcpy(data, d, sizeof(data)); } |