From 6d28e0a039d5ca1c9f11f3a65f67ae2adcca474b Mon Sep 17 00:00:00 2001 From: Chris Beall Date: Wed, 11 Apr 2012 15:15:12 +0000 Subject: [PATCH] fixed size skewSymmetric --- gtsam/base/Matrix.cpp | 6 +++--- gtsam/base/Matrix.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gtsam/base/Matrix.cpp b/gtsam/base/Matrix.cpp index b3c51325d..849dc3f5a 100644 --- a/gtsam/base/Matrix.cpp +++ b/gtsam/base/Matrix.cpp @@ -541,12 +541,12 @@ Matrix vector_scale(const Matrix& A, const Vector& v, bool inf_mask) { } /* ************************************************************************* */ -Matrix skewSymmetric(double wx, double wy, double wz) +Matrix3 skewSymmetric(double wx, double wy, double wz) { - return Matrix_(3,3, + return (Matrix3() << 0.0, -wz, +wy, +wz, 0.0, -wx, - -wy, +wx, 0.0); + -wy, +wx, 0.0).finished(); } /* ************************************************************************* */ diff --git a/gtsam/base/Matrix.h b/gtsam/base/Matrix.h index 4fe3a56c4..131c5f958 100644 --- a/gtsam/base/Matrix.h +++ b/gtsam/base/Matrix.h @@ -395,7 +395,7 @@ Matrix vector_scale(const Matrix& A, const Vector& v, bool inf_mask = false); // * @param wz * @return a 3*3 skew symmetric matrix */ -Matrix skewSymmetric(double wx, double wy, double wz); +Matrix3 skewSymmetric(double wx, double wy, double wz); inline Matrix skewSymmetric(const Vector& w) { return skewSymmetric(w(0),w(1),w(2));} /** Use SVD to calculate inverse square root of a matrix */