diff --git a/gtsam/inference/BayesNet-inl.h b/gtsam/inference/BayesNet-inl.h index c306cb39d..912e49ef4 100644 --- a/gtsam/inference/BayesNet-inl.h +++ b/gtsam/inference/BayesNet-inl.h @@ -112,14 +112,14 @@ namespace gtsam { /* ************************************************************************* */ template - void BayesNet::push_back(const BayesNet bn) { + void BayesNet::push_back(const BayesNet& bn) { BOOST_FOREACH(sharedConditional conditional,bn.conditionals_) push_back(conditional); } /* ************************************************************************* */ template - void BayesNet::push_front(const BayesNet bn) { + void BayesNet::push_front(const BayesNet& bn) { BOOST_FOREACH(sharedConditional conditional,bn.conditionals_) push_front(conditional); } diff --git a/gtsam/inference/BayesNet.h b/gtsam/inference/BayesNet.h index 67d59c48d..4fa10eee2 100644 --- a/gtsam/inference/BayesNet.h +++ b/gtsam/inference/BayesNet.h @@ -93,9 +93,6 @@ public: void print(const std::string& s = "", const IndexFormatter& formatter = DefaultIndexFormatter) const; - /** print statistics */ - void printStats(const std::string& s = "") const; - /** check equality */ bool equals(const BayesNet& other, double tol = 1e-9) const; @@ -108,6 +105,9 @@ public: return conditionals_.size(); } + /** print statistics */ + void printStats(const std::string& s = "") const; + /** return keys in reverse topological sort order, i.e., elimination order */ FastList ordering() const; @@ -190,10 +190,10 @@ public: } /// push_back an entire Bayes net - void push_back(const BayesNet bn); + void push_back(const BayesNet& bn); /// push_front an entire Bayes net - void push_front(const BayesNet bn); + void push_front(const BayesNet& bn); /** += syntax for push_back, e.g. bayesNet += c1, c2, c3 * @param conditional The conditional to add to the back of the BayesNet