From cb5f18603123caa369f6bce798f163711affcf39 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Sun, 28 Oct 2012 06:43:05 +0000 Subject: [PATCH] Two more patches after last checkin - removed numCachedShortcuts from MATLAB wrapper, and added EliminateQR as default argument to GaussianFactorGraph eliminate functions --- gtsam.h | 2 -- gtsam/linear/GaussianFactorGraph.h | 10 +++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gtsam.h b/gtsam.h index d8b92d130..48a86e248 100644 --- a/gtsam.h +++ b/gtsam.h @@ -810,7 +810,6 @@ virtual class BayesTree { void clear(); void deleteCachedShortcuts(); void insert(const CLIQUE* subtree); - size_t numCachedShortcuts() const; size_t numCachedSeparatorMarginals() const; }; @@ -824,7 +823,6 @@ virtual class BayesTreeClique { void print(string s) const; void printTree() const; // Default indent of "" void printTree(string indent) const; - size_t numCachedShortcuts() const; size_t numCachedSeparatorMarginals() const; CONDITIONAL* conditional() const; diff --git a/gtsam/linear/GaussianFactorGraph.h b/gtsam/linear/GaussianFactorGraph.h index 90086c1e5..1dbc3a6bc 100644 --- a/gtsam/linear/GaussianFactorGraph.h +++ b/gtsam/linear/GaussianFactorGraph.h @@ -31,6 +31,10 @@ namespace gtsam { + // Forward declaration to use as default argument, documented declaration below. + FactorGraph::EliminationResult + EliminateQR(const FactorGraph& factors, size_t nrFrontals); + /** * A Linear Factor Graph is a factor graph where all factors are Gaussian, i.e. * Factor == GaussianFactor @@ -122,7 +126,7 @@ namespace gtsam { * FactorGraph::eliminateFrontals with EliminateQR as the * eliminate function argument. */ - std::pair eliminateFrontals(size_t nFrontals, const Eliminate& function) const { + std::pair eliminateFrontals(size_t nFrontals, const Eliminate& function = EliminateQR) const { return Base::eliminateFrontals(nFrontals, function); } /** Factor the factor graph into a conditional and a remaining factor graph. @@ -141,11 +145,11 @@ namespace gtsam { * FactorGraph::eliminate with EliminateQR as the eliminate * function argument. */ - std::pair eliminate(const std::vector& variables, const Eliminate& function) { + std::pair eliminate(const std::vector& variables, const Eliminate& function = EliminateQR) { return Base::eliminate(variables, function); } /** Eliminate a single variable, by calling GaussianFactorGraph::eliminate. */ - std::pair eliminateOne(Index variable, const Eliminate& function) { + std::pair eliminateOne(Index variable, const Eliminate& function = EliminateQR) { return Base::eliminateOne(variable, function); } /** Permute the variables in the factors */