From ed6a077e9e5ad778cbb86c95c0e138d8b2c40ea1 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Fri, 5 Jul 2013 20:45:56 +0000 Subject: [PATCH] Made FactorGraph equals protected since it should be overridden --- gtsam/inference/FactorGraphUnordered.h | 6 ++++-- gtsam/symbolic/SymbolicBayesNetUnordered.cpp | 4 +++- gtsam/symbolic/SymbolicBayesNetUnordered.h | 16 +++++++++++----- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/gtsam/inference/FactorGraphUnordered.h b/gtsam/inference/FactorGraphUnordered.h index b81c1d9ce..b2467e82d 100644 --- a/gtsam/inference/FactorGraphUnordered.h +++ b/gtsam/inference/FactorGraphUnordered.h @@ -155,12 +155,14 @@ namespace gtsam { /** print out graph */ void print(const std::string& s = "FactorGraph", - const KeyFormatter& formatter = DefaultKeyFormatter) const; + const KeyFormatter& formatter = DefaultKeyFormatter) const; + protected: /** Check equality */ bool equals(const This& fg, double tol = 1e-9) const; - /// @} + + public: /// @name Standard Interface /// @{ diff --git a/gtsam/symbolic/SymbolicBayesNetUnordered.cpp b/gtsam/symbolic/SymbolicBayesNetUnordered.cpp index e340f4f71..c43d6425b 100644 --- a/gtsam/symbolic/SymbolicBayesNetUnordered.cpp +++ b/gtsam/symbolic/SymbolicBayesNetUnordered.cpp @@ -22,7 +22,9 @@ namespace gtsam { /* ************************************************************************* */ - void SymbolicBayesNetUnordered::noop() const { + bool SymbolicBayesNetUnordered::equals(const This& bn, double tol = 1e-9) const + { + return Base::equals(bn, tol); } diff --git a/gtsam/symbolic/SymbolicBayesNetUnordered.h b/gtsam/symbolic/SymbolicBayesNetUnordered.h index 7eb137e9c..9fbd4f7ad 100644 --- a/gtsam/symbolic/SymbolicBayesNetUnordered.h +++ b/gtsam/symbolic/SymbolicBayesNetUnordered.h @@ -18,9 +18,9 @@ #pragma once -#include -#include #include +#include +#include namespace gtsam { @@ -47,13 +47,19 @@ namespace gtsam { SymbolicBayesNetUnordered(ITERATOR firstConditional, ITERATOR lastConditional) : Base(firstConditional, lastConditional) {} /// @} + + /// @name Testable + /// @{ + + /** Check equality */ + bool equals(const This& bn, double tol = 1e-9) const; + + /// @} + /// @name Standard Interface /// @{ /// @} - - private: - void noop() const; // Function defined in cpp file so that compiler instantiates the base class }; } // namespace gtsam