From 2b9105b0ce2f8abaad0daef6c27c2907fc5bf3bb Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Thu, 1 Aug 2013 21:57:24 +0000 Subject: [PATCH] Added optional ordering to GFG::optimize() --- gtsam/linear/GaussianFactorGraph.cpp | 4 ++-- gtsam/linear/GaussianFactorGraph.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gtsam/linear/GaussianFactorGraph.cpp b/gtsam/linear/GaussianFactorGraph.cpp index c67008ba1..99802a547 100644 --- a/gtsam/linear/GaussianFactorGraph.cpp +++ b/gtsam/linear/GaussianFactorGraph.cpp @@ -196,10 +196,10 @@ namespace gtsam { //} /* ************************************************************************* */ - VectorValues GaussianFactorGraph::optimize(const Eliminate& function) const + VectorValues GaussianFactorGraph::optimize(OptionalOrdering ordering, const Eliminate& function) const { gttic(GaussianFactorGraph_optimize); - return BaseEliminateable::eliminateMultifrontal(boost::none, function)->optimize(); + return BaseEliminateable::eliminateMultifrontal(ordering, function)->optimize(); } /* ************************************************************************* */ diff --git a/gtsam/linear/GaussianFactorGraph.h b/gtsam/linear/GaussianFactorGraph.h index 78004299d..6c9cf9f23 100644 --- a/gtsam/linear/GaussianFactorGraph.h +++ b/gtsam/linear/GaussianFactorGraph.h @@ -207,7 +207,8 @@ namespace gtsam { * the dense elimination function specified in \c function (default EliminatePreferCholesky), * followed by back-substitution in the Bayes tree resulting from elimination. Is equivalent * to calling graph.eliminateMultifrontal()->optimize(). */ - VectorValues optimize(const Eliminate& function = EliminationTraits::DefaultEliminate) const; + VectorValues optimize(OptionalOrdering ordering = boost::none, + const Eliminate& function = EliminationTraits::DefaultEliminate) const; /** * Compute the gradient of the energy function,