From c4a88102ef43e390d33279c9b136d1d8a1d68062 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Wed, 7 Sep 2011 02:43:44 +0000 Subject: [PATCH] Removed spurious Testable inheritance --- gtsam/inference/Conditional.h | 2 +- gtsam/slam/ProjectionFactor.h | 37 ++++++++++++++++------------------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/gtsam/inference/Conditional.h b/gtsam/inference/Conditional.h index 55cdda7a7..72fdbc44c 100644 --- a/gtsam/inference/Conditional.h +++ b/gtsam/inference/Conditional.h @@ -42,7 +42,7 @@ namespace gtsam { * immutable, i.e., practicing functional programming. */ template -class Conditional: public gtsam::Factor, boost::noncopyable, public Testable > { +class Conditional: public gtsam::Factor, boost::noncopyable { private: diff --git a/gtsam/slam/ProjectionFactor.h b/gtsam/slam/ProjectionFactor.h index 5a0ad4f1f..d1a6dfe4c 100644 --- a/gtsam/slam/ProjectionFactor.h +++ b/gtsam/slam/ProjectionFactor.h @@ -29,8 +29,8 @@ namespace gtsam { * Non-linear factor for a constraint derived from a 2D measurement. The calibration is known here. * i.e. the main building block for visual SLAM. */ - template - class GenericProjectionFactor : public NonlinearFactor2, Testable > { + template + class GenericProjectionFactor: public NonlinearFactor2 { protected: // Keep a copy of measurement and calibration for I/O @@ -39,16 +39,16 @@ namespace gtsam { public: - // shorthand for base class type + /// shorthand for base class type typedef NonlinearFactor2 Base; - // shorthand for a smart pointer to a factor + /// shorthand for a smart pointer to a factor typedef boost::shared_ptr > shared_ptr; - /** - * Default constructor - */ - GenericProjectionFactor() : K_(new Cal3_S2(444, 555, 666, 777, 888)) {} + /// Default constructor + GenericProjectionFactor() : + K_(new Cal3_S2(444, 555, 666, 777, 888)) { + } /** * Constructor @@ -58,10 +58,9 @@ namespace gtsam { * @param landmarkNumber is the index of the landmark * @param K the constant calibration */ - GenericProjectionFactor(const Point2& z, - const SharedNoiseModel& model, POSK j_pose, - LMK j_landmark, const shared_ptrK& K) : - Base(model, j_pose, j_landmark), z_(z), K_(K) { + GenericProjectionFactor(const Point2& z, const SharedNoiseModel& model, + POSK j_pose, LMK j_landmark, const shared_ptrK& K) : + Base(model, j_pose, j_landmark), z_(z), K_(K) { } /** @@ -73,17 +72,14 @@ namespace gtsam { z_.print(s + ".z"); } - /** - * equals - */ - bool equals(const GenericProjectionFactor& p, double tol = 1e-9) const { + /// equals + bool equals(const GenericProjectionFactor& p + , double tol = 1e-9) const { return Base::equals(p, tol) && this->z_.equals(p.z_, tol) && this->K_->equals(*p.K_, tol); } - - - /** h(x)-z */ + /// Evaluate error h(x)-z and optionally derivatives Vector evaluateError(const Pose3& pose, const Point3& point, boost::optional H1, boost::optional H2) const { SimpleCamera camera(*K_, pose); @@ -92,7 +88,8 @@ namespace gtsam { } private: - /** Serialization function */ + + /// Serialization function friend class boost::serialization::access; template void serialize(ARCHIVE & ar, const unsigned int version) {