diff --git a/gtsam/nonlinear/ISAM2.h b/gtsam/nonlinear/ISAM2.h index 159f88ad4..e4de22e6e 100644 --- a/gtsam/nonlinear/ISAM2.h +++ b/gtsam/nonlinear/ISAM2.h @@ -489,8 +489,11 @@ public: /** Create an empty ISAM2 instance using the default set of parameters (see ISAM2Params) */ ISAM2(); + /** default virtual destructor */ + virtual ~ISAM2() {} + /** Compare equality */ - bool equals(const ISAM2& other, double tol = 1e-9) const; + virtual bool equals(const ISAM2& other, double tol = 1e-9) const; /** * Add new factors, updating the solution and relinearizing as needed. @@ -520,7 +523,8 @@ public: * of the size of the linear delta. This allows the provided keys to be reordered. * @return An ISAM2Result struct containing information about the update */ - ISAM2Result update(const NonlinearFactorGraph& newFactors = NonlinearFactorGraph(), const Values& newTheta = Values(), + virtual ISAM2Result update(const NonlinearFactorGraph& newFactors = NonlinearFactorGraph(), + const Values& newTheta = Values(), const std::vector& removeFactorIndices = std::vector(), const boost::optional >& constrainedKeys = boost::none, const boost::optional >& noRelinKeys = boost::none, @@ -622,13 +626,13 @@ public: /// @} -private: +protected: FastSet getAffectedFactors(const FastList& keys) const; GaussianFactorGraph::shared_ptr relinearizeAffectedFactors(const FastList& affectedKeys, const FastSet& relinKeys) const; GaussianFactorGraph getCachedBoundaryFactors(Cliques& orphans); - boost::shared_ptr > recalculate(const FastSet& markedKeys, const FastSet& relinKeys, + virtual boost::shared_ptr > recalculate(const FastSet& markedKeys, const FastSet& relinKeys, const std::vector& observedKeys, const FastSet& unusedIndices, const boost::optional >& constrainKeys, ISAM2Result& result); // void linear_update(const GaussianFactorGraph& newFactors); void updateDelta(bool forceFullSolve = false) const;