From e9ae4f3c4da23e4fd5feebbd8af3400f52a76ab0 Mon Sep 17 00:00:00 2001 From: Mike Bosse Date: Tue, 16 Dec 2014 01:28:02 +0100 Subject: [PATCH] stuck since LieMatrix uses dynamic matrices and hence not compatible with traits --- gtsam/base/LieScalar.h | 2 +- gtsam/base/LieVector.cpp | 1 + gtsam/base/OptionalJacobian.h | 7 +++++-- gtsam/base/concepts.h | 6 ++++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/gtsam/base/LieScalar.h b/gtsam/base/LieScalar.h index f83982fa9..e92176c3b 100644 --- a/gtsam/base/LieScalar.h +++ b/gtsam/base/LieScalar.h @@ -38,7 +38,7 @@ namespace gtsam { LieScalar() : d_(0.0) {} /** wrap a double */ - explicit LieScalar(double d) : d_(d) {} + /*explicit*/ LieScalar(double d) : d_(d) {} /** access the underlying value */ double value() const { return d_; } diff --git a/gtsam/base/LieVector.cpp b/gtsam/base/LieVector.cpp index f6cae28e2..5b11999f4 100644 --- a/gtsam/base/LieVector.cpp +++ b/gtsam/base/LieVector.cpp @@ -35,4 +35,5 @@ void LieVector::print(const std::string& name) const { gtsam::print(vector(), name); } +GTSAM_CONCEPT_LIE_INST(LieVector) } // \namespace gtsam diff --git a/gtsam/base/OptionalJacobian.h b/gtsam/base/OptionalJacobian.h index bae1fb3d6..29ff6146f 100644 --- a/gtsam/base/OptionalJacobian.h +++ b/gtsam/base/OptionalJacobian.h @@ -112,8 +112,11 @@ public: Eigen::Map* operator->(){ return &map_; } }; -template<> -class OptionalJacobian<-1, -1> {}; +// these make sure that no dynamic sized matrices are compiled. +template +class OptionalJacobian<-1, Cols> {}; +template +class OptionalJacobian {}; } // namespace gtsam diff --git a/gtsam/base/concepts.h b/gtsam/base/concepts.h index 626542fef..29b68e7c9 100644 --- a/gtsam/base/concepts.h +++ b/gtsam/base/concepts.h @@ -67,9 +67,10 @@ namespace internal { /// A helper that implements the traits interface for GTSAM manifolds. /// To use this for your gtsam type, define: /// template<> struct traits : public Manifold { }; -template +template struct Manifold { // Typedefs required by all manifold types. + typedef _ManifoldType ManifoldType; typedef manifold_tag structure_category; enum { dimension = ManifoldType::dimension }; typedef Eigen::Matrix TangentVector; @@ -117,9 +118,10 @@ struct Manifold { /// A helper that implements the traits interface for GTSAM lie groups. /// To use this for your gtsam type, define: /// template<> struct traits : public LieGroup { }; -template +template struct LieGroup { // Typedefs required by all manifold types. + typedef _ManifoldType ManifoldType; typedef lie_group_tag structure_category; typedef _group_flavor group_flavor;