diff --git a/gtsam/geometry/PinholePose.h b/gtsam/geometry/PinholePose.h index 92ae0f6fc..5cad3b6e7 100644 --- a/gtsam/geometry/PinholePose.h +++ b/gtsam/geometry/PinholePose.h @@ -59,17 +59,12 @@ public: /// @name Advanced Constructors /// @{ - explicit PinholeBaseK(const Vector &v) : - PinholeBase(v) { - } + explicit PinholeBaseK(const Vector& v) : PinholeBase(v) {} /// @} /// @name Standard Interface /// @{ - virtual ~PinholeBaseK() override { - } - /// return calibration virtual const CALIBRATION& calibration() const = 0; diff --git a/gtsam/linear/GaussianFactor.h b/gtsam/linear/GaussianFactor.h index 3441861e2..c5133c6b2 100644 --- a/gtsam/linear/GaussianFactor.h +++ b/gtsam/linear/GaussianFactor.h @@ -42,6 +42,9 @@ namespace gtsam { typedef std::shared_ptr shared_ptr; ///< shared_ptr to this class typedef Factor Base; ///< Our base class + /// @name Standard Constructors + /// @{ + /** Default constructor creates empty factor */ GaussianFactor() {} @@ -50,19 +53,22 @@ namespace gtsam { template GaussianFactor(const CONTAINER& keys) : Base(keys) {} - /** Destructor */ - virtual ~GaussianFactor() override {} + /// @} + /// @name Testable + /// @{ - // Implementing Testable interface - - /// print + /// print with optional string void print( const std::string& s = "", const KeyFormatter& formatter = DefaultKeyFormatter) const override = 0; - /** Equals for testable */ + /// assert equality up to a tolerance virtual bool equals(const GaussianFactor& lf, double tol = 1e-9) const = 0; + /// @} + /// @name Standard Interface + /// @{ + /** * In Gaussian factors, the error function returns either the negative log-likelihood, e.g., * 0.5*(A*x-b)'*D*(A*x-b) @@ -144,6 +150,10 @@ namespace gtsam { virtual void updateHessian(const KeyVector& keys, SymmetricBlockMatrix* info) const = 0; + /// @} + /// @name Operator interface + /// @{ + /// y += alpha * A'*A*x virtual void multiplyHessianAdd(double alpha, const VectorValues& x, VectorValues& y) const = 0; @@ -156,12 +166,18 @@ namespace gtsam { /// Gradient wrt a key at any values virtual Vector gradient(Key key, const VectorValues& x) const = 0; + /// @} + /// @name Advanced Interface + /// @{ + // Determine position of a given key template static DenseIndex Slot(const CONTAINER& keys, Key key) { return std::find(keys.begin(), keys.end(), key) - keys.begin(); } + /// @} + private: #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION /** Serialization function */ @@ -171,7 +187,6 @@ namespace gtsam { ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base); } #endif - }; // GaussianFactor /// traits diff --git a/gtsam/linear/GaussianFactorGraph.h b/gtsam/linear/GaussianFactorGraph.h index 96122eb6b..6a7848f51 100644 --- a/gtsam/linear/GaussianFactorGraph.h +++ b/gtsam/linear/GaussianFactorGraph.h @@ -107,9 +107,6 @@ namespace gtsam { template GaussianFactorGraph(const FactorGraph& graph) : Base(graph) {} - /** Virtual destructor */ - virtual ~GaussianFactorGraph() override {} - /// @} /// @name Testable /// @{ diff --git a/gtsam/nonlinear/NonlinearFactor.h b/gtsam/nonlinear/NonlinearFactor.h index c2e246add..57c4a00eb 100644 --- a/gtsam/nonlinear/NonlinearFactor.h +++ b/gtsam/nonlinear/NonlinearFactor.h @@ -105,9 +105,6 @@ public: /// @name Standard Interface /// @{ - /** Destructor */ - virtual ~NonlinearFactor() override {} - /** * In nonlinear factors, the error function returns the negative log-likelihood * as a non-linear function of the values in a \class Values object. diff --git a/gtsam/nonlinear/NonlinearFactorGraph.h b/gtsam/nonlinear/NonlinearFactorGraph.h index d4d3ea488..bf56d835f 100644 --- a/gtsam/nonlinear/NonlinearFactorGraph.h +++ b/gtsam/nonlinear/NonlinearFactorGraph.h @@ -78,9 +78,6 @@ namespace gtsam { template NonlinearFactorGraph(const FactorGraph& graph) : Base(graph) {} - /// Destructor - virtual ~NonlinearFactorGraph() override {} - /// @} /// @name Testable /// @{ diff --git a/gtsam/symbolic/SymbolicFactor.h b/gtsam/symbolic/SymbolicFactor.h index b4b9b6dab..190609ecb 100644 --- a/gtsam/symbolic/SymbolicFactor.h +++ b/gtsam/symbolic/SymbolicFactor.h @@ -79,8 +79,6 @@ namespace gtsam { /** Create symbolic version of any factor */ explicit SymbolicFactor(const Factor& factor) : Base(factor.keys()) {} - virtual ~SymbolicFactor() override {} - /// Copy this object as its actual derived type. SymbolicFactor::shared_ptr clone() const { return std::make_shared(*this); }