From 2a2deff33811946ed78787c1648988ed855f7c01 Mon Sep 17 00:00:00 2001 From: HannesSommer Date: Tue, 11 Nov 2014 19:32:17 +0100 Subject: [PATCH] added missing OutOptions to the Reshape functor --- gtsam/base/Manifold.h | 4 ++-- gtsam/base/Matrix.h | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gtsam/base/Manifold.h b/gtsam/base/Manifold.h index fb926c630..a5a3d5f34 100644 --- a/gtsam/base/Manifold.h +++ b/gtsam/base/Manifold.h @@ -253,10 +253,10 @@ struct DefaultChart > { typedef Eigen::Matrix::value, 1> vector;BOOST_STATIC_ASSERT_MSG((M!=Eigen::Dynamic && N!=Eigen::Dynamic), "DefaultChart has not been implemented yet for dynamically sized matrices"); static vector local(const T& origin, const T& other) { - return reshape(other) - reshape(origin); + return reshape(other) - reshape(origin); } static T retract(const T& origin, const vector& d) { - return origin + reshape(d); + return origin + reshape(d); } static int getDimension(const T&origin) { return origin.rows() * origin.cols(); diff --git a/gtsam/base/Matrix.h b/gtsam/base/Matrix.h index 00caed44a..132bf79ad 100644 --- a/gtsam/base/Matrix.h +++ b/gtsam/base/Matrix.h @@ -294,10 +294,10 @@ void zeroBelowDiagonal(MATRIX& A, size_t cols=0) { inline Matrix trans(const Matrix& A) { return A.transpose(); } /// Reshape functor -template +template struct Reshape { //TODO replace this with Eigen's reshape function as soon as available. (There is a PR already pending : https://bitbucket.org/eigen/eigen/pull-request/41/reshape/diff) - typedef Eigen::Map > ReshapedType; + typedef Eigen::Map > ReshapedType; static inline ReshapedType reshape(const Eigen::Matrix & in) { return in.data(); } @@ -305,7 +305,7 @@ struct Reshape { /// Reshape specialization that does nothing as shape stays the same (needed to not be ambiguous for square input equals square output) template -struct Reshape { +struct Reshape { typedef const Eigen::Matrix & ReshapedType; static inline ReshapedType reshape(const Eigen::Matrix & in) { return in; @@ -314,7 +314,7 @@ struct Reshape { /// Reshape specialization that does nothing as shape stays the same template -struct Reshape { +struct Reshape { typedef const Eigen::Matrix & ReshapedType; static inline ReshapedType reshape(const Eigen::Matrix & in) { return in; @@ -323,17 +323,17 @@ struct Reshape { /// Reshape specialization that does transpose template -struct Reshape { +struct Reshape { typedef typename Eigen::Matrix::ConstTransposeReturnType ReshapedType; static inline ReshapedType reshape(const Eigen::Matrix & in) { return in.transpose(); } }; -template -inline typename Reshape::ReshapedType reshape(const Eigen::Matrix & m){ +template +inline typename Reshape::ReshapedType reshape(const Eigen::Matrix & m){ BOOST_STATIC_ASSERT(InM * InN == OutM * OutN); - return Reshape::reshape(m); + return Reshape::reshape(m); } /**