From f10cbb011fd18782b512ba50785a08b7965c87e4 Mon Sep 17 00:00:00 2001 From: "DrZiplok@gmail.com" Date: Mon, 14 Feb 2011 04:26:05 +0000 Subject: [PATCH] ::transposed does not change the matrix; make it const. git-svn-id: https://arducopter.googlecode.com/svn/trunk@1648 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/AP_Math/matrix3.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/AP_Math/matrix3.h b/libraries/AP_Math/matrix3.h index 85f4516607..df66ded0d7 100644 --- a/libraries/AP_Math/matrix3.h +++ b/libraries/AP_Math/matrix3.h @@ -49,8 +49,8 @@ public: Matrix3(const Vector3 a0, const Vector3 b0, const Vector3 c0): a(a0), b(b0), c(c0) {} // setting ctor - Matrix3(const T ax, const T ay, const T az, const T bx, const T by, const T bz, const T cx, const T cy, const T cz): a(ax,ay,az), b(bx,by,bz), c(cx,cy,cz) {} - + Matrix3(const T ax, const T ay, const T az, const T bx, const T by, const T bz, const T cx, const T cy, const T cz): a(ax,ay,az), b(bx,by,bz), c(cx,cy,cz) {} + // function call operator void operator () (const Vector3 a0, const Vector3 b0, const Vector3 c0) { a = a0; b = b0; c = c0; } @@ -78,7 +78,7 @@ public: { return Matrix3(a-m.a, b-m.b, c-m.c); } Matrix3 &operator -= (const Matrix3 &m) { return *this = *this - m; } - + // uniform scaling Matrix3 operator * (const T num) const { return Matrix3(a*num, b*num, c*num); } @@ -88,13 +88,13 @@ public: { return Matrix3(a/num, b/num, c/num); } Matrix3 &operator /= (const T num) { return *this = *this / num; } - + // multiplication by a vector Vector3 operator *(const Vector3 &v) const { return Vector3(a.x * v.x + a.y * v.y + a.z * v.z, b.x * v.x + b.y * v.y + b.z * v.z, - c.x * v.x + c.y * v.y + c.z * v.z); + c.x * v.x + c.y * v.y + c.z * v.z); } // multiplication by another Matrix3 @@ -115,7 +115,7 @@ public: { return *this = *this * m; } // transpose the matrix - Matrix3 transposed(void) + Matrix3 transposed(void) const { return Matrix3(Vector3(a.x, b.x, c.x), Vector3(a.y, b.y, c.y),