From 360f0e9d6b73ba004b9c143ce833d75226f39e53 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Tue, 9 Oct 2012 13:09:47 +0000 Subject: [PATCH] ifdef to make BayesTree joint marginals fall back on sequential solver joints to avoid duplicate information problem --- gtsam/inference/BayesTree-inl.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gtsam/inference/BayesTree-inl.h b/gtsam/inference/BayesTree-inl.h index 9df47af2c..2afc88e8a 100644 --- a/gtsam/inference/BayesTree-inl.h +++ b/gtsam/inference/BayesTree-inl.h @@ -565,6 +565,7 @@ namespace gtsam { typename FactorGraph::shared_ptr BayesTree::joint(Index j1, Index j2, Eliminate function) const { +#ifdef SHORTCUT_JOINTS // get clique C1 and C2 sharedClique C1 = (*this)[j1], C2 = (*this)[j2]; @@ -575,6 +576,13 @@ namespace gtsam { std::vector j12(2); j12[0] = j1; j12[1] = j2; GenericSequentialSolver solver(p_C1C2); return solver.jointFactorGraph(j12,function); +#else + std::vector indices(2); + indices[0] = j1; + indices[1] = j2; + GenericSequentialSolver solver(FactorGraph(*this)); + return solver.jointFactorGraph(indices, function); +#endif } /* ************************************************************************* */