diff --git a/gtsam/inference/FactorGraph-inl.h b/gtsam/inference/FactorGraph-inl.h index 51aab7d43..f9dda2869 100644 --- a/gtsam/inference/FactorGraph-inl.h +++ b/gtsam/inference/FactorGraph-inl.h @@ -47,14 +47,6 @@ using namespace std; namespace gtsam { - /* ************************************************************************* */ - template - void FactorGraph::push_back(const FactorGraph& factors) { - const_iterator factor = factors.begin(); - for (; factor != factors.end(); factor++) - push_back(*factor); - } - /* ************************************************************************* */ template void FactorGraph::print(const string& s) const { diff --git a/gtsam/inference/FactorGraph.h b/gtsam/inference/FactorGraph.h index 889b1e246..e24fde728 100644 --- a/gtsam/inference/FactorGraph.h +++ b/gtsam/inference/FactorGraph.h @@ -72,18 +72,18 @@ namespace gtsam { /** convert from a derived type */ template - FactorGraph(const FactorGraph& factorGraph); + FactorGraph(const FactorGraph& factors) { factors_.insert(end(), factors.begin(), factors.end()); } /** Add a factor */ template void push_back(const boost::shared_ptr& factor) { factors_.push_back(sharedFactor(factor)); } /** push back many factors */ - void push_back(const FactorGraph& factors); + void push_back(const FactorGraph& factors) { factors_.insert(end(), factors.begin(), factors.end()); } /** push back many factors with an iterator */ template - void push_back(ITERATOR firstFactor, ITERATOR lastFactor); + void push_back(ITERATOR firstFactor, ITERATOR lastFactor) { factors_.insert(end(), firstFactor, lastFactor); } /** push back many factors stored in a vector*/ template @@ -208,16 +208,6 @@ namespace gtsam { * type. */ - /* ************************************************************************* */ - template - template - FactorGraph::FactorGraph(const FactorGraph& factorGraph) { - factors_.reserve(factorGraph.size()); - BOOST_FOREACH(const typename DERIVEDFACTOR::shared_ptr& factor, factorGraph) { - this->push_back(factor); - } - } - /* ************************************************************************* */ template template @@ -228,15 +218,6 @@ namespace gtsam { } } - /* ************************************************************************* */ - template - template - void FactorGraph::push_back(ITERATOR firstFactor, ITERATOR lastFactor) { - ITERATOR factor = firstFactor; - while(factor != lastFactor) - this->push_back(*(factor++)); - } - /* ************************************************************************* */ template template