21#include <boost/shared_ptr.hpp>
23#include <boost/variant.hpp>
24#include <boost/optional.hpp>
55 template<
class FACTOR_GRAPH>
60 typedef FACTOR_GRAPH FactorGraphType;
86 typedef std::pair<boost::shared_ptr<ConditionalType>, boost::shared_ptr<_FactorType> >
EliminationResult;
119 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
138 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
159 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
173 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
180 std::pair<boost::shared_ptr<BayesNetType>, boost::shared_ptr<FactorGraphType> >
183 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
190 std::pair<boost::shared_ptr<BayesNetType>, boost::shared_ptr<FactorGraphType> >
193 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
200 std::pair<boost::shared_ptr<BayesTreeType>, boost::shared_ptr<FactorGraphType> >
203 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
210 std::pair<boost::shared_ptr<BayesTreeType>, boost::shared_ptr<FactorGraphType> >
213 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
226 boost::variant<const Ordering&, const KeyVector&> variables,
227 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
241 boost::variant<const Ordering&, const KeyVector&> variables,
242 const Ordering& marginalizedVariableOrdering,
243 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
256 boost::variant<const Ordering&, const KeyVector&> variables,
257 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
271 boost::variant<const Ordering&, const KeyVector&> variables,
272 const Ordering& marginalizedVariableOrdering,
273 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
279 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
285 const FactorGraphType& asDerived()
const {
return static_cast<const FactorGraphType&
>(*this); }
288 FactorGraphType& asDerived() {
return static_cast<FactorGraphType&
>(*this); }
291 #ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V42
294 const Ordering& ordering,
311 const Ordering& ordering,
328 boost::variant<const Ordering&, const KeyVector&> variables,
330 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
337 boost::variant<const Ordering&, const KeyVector&> variables,
339 const Eliminate& function = EliminationTraitsType::DefaultEliminate,
Variable ordering for the elimination algorithm.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition Key.h:86
Traits class for eliminateable factor graphs, specifies the types that result from elimination,...
Definition EliminateableFactorGraph.h:36
EliminateableFactorGraph is a base class for factor graphs that contains elimination algorithms.
Definition EliminateableFactorGraph.h:57
boost::shared_ptr< BayesTreeType > eliminateMultifrontal(const Ordering &ordering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
Do multifrontal elimination of all variables to produce a Bayes tree.
Definition EliminateableFactorGraph-inst.h:127
boost::shared_ptr< BayesTreeType > marginalMultifrontalBayesTree(boost::variant< const Ordering &, const KeyVector & > variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
Compute the marginal of the requested variables and return the result as a Bayes tree.
Definition EliminateableFactorGraph-inst.h:300
EliminationTraitsType::JunctionTreeType JunctionTreeType
Definition EliminateableFactorGraph.h:82
boost::shared_ptr< FactorGraphType > marginal(const KeyVector &variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
Compute the marginal factor graph of the requested variables.
Definition EliminateableFactorGraph-inst.h:367
std::pair< boost::shared_ptr< BayesNetType >, boost::shared_ptr< FactorGraphType > > eliminatePartialSequential(const KeyVector &variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
Do sequential elimination of the given variables in an ordering computed by COLAMD to produce a Bayes...
Definition EliminateableFactorGraph-inst.h:172
boost::shared_ptr< BayesNetType > marginalMultifrontalBayesNet(boost::variant< const Ordering &, const KeyVector & > variables, const Ordering &marginalizedVariableOrdering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
Compute the marginal of the requested variables and return the result as a Bayes net.
Definition EliminateableFactorGraph-inst.h:265
std::function< EliminationResult(const FactorGraphType &, const Ordering &)> Eliminate
Definition EliminateableFactorGraph.h:89
EliminationTraitsType::BayesTreeType BayesTreeType
Definition EliminateableFactorGraph.h:79
boost::shared_ptr< BayesNetType > eliminateSequential(const Ordering &ordering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
Do sequential elimination of all variables to produce a Bayes net.
Definition EliminateableFactorGraph-inst.h:64
EliminationTraitsType::BayesNetType BayesNetType
Definition EliminateableFactorGraph.h:73
std::pair< boost::shared_ptr< ConditionalType >, boost::shared_ptr< _FactorType > > EliminationResult
Definition EliminateableFactorGraph.h:86
boost::shared_ptr< BayesNetType > eliminateSequential(OptionalOrderingType orderingType=boost::none, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
Do sequential elimination of all variables to produce a Bayes net.
Definition EliminateableFactorGraph-inst.h:30
boost::shared_ptr< BayesTreeType > eliminateMultifrontal(OptionalOrderingType orderingType=boost::none, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
Do multifrontal elimination of all variables to produce a Bayes tree.
Definition EliminateableFactorGraph-inst.h:91
boost::shared_ptr< BayesTreeType > marginalMultifrontalBayesTree(boost::variant< const Ordering &, const KeyVector & > variables, const Ordering &marginalizedVariableOrdering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
Compute the marginal of the requested variables and return the result as a Bayes tree.
Definition EliminateableFactorGraph-inst.h:332
EliminationTraitsType::ConditionalType ConditionalType
Definition EliminateableFactorGraph.h:70
EliminationTraitsType::EliminationTreeType EliminationTreeType
Definition EliminateableFactorGraph.h:76
boost::optional< const VariableIndex & > OptionalVariableIndex
Definition EliminateableFactorGraph.h:92
std::pair< boost::shared_ptr< BayesNetType >, boost::shared_ptr< FactorGraphType > > eliminatePartialSequential(const Ordering &ordering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
Do sequential elimination of some variables, in ordering provided, to produce a Bayes net and a remai...
Definition EliminateableFactorGraph-inst.h:154
boost::shared_ptr< BayesNetType > marginalMultifrontalBayesNet(boost::variant< const Ordering &, const KeyVector & > variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
Compute the marginal of the requested variables and return the result as a Bayes net.
Definition EliminateableFactorGraph-inst.h:233
std::pair< boost::shared_ptr< BayesTreeType >, boost::shared_ptr< FactorGraphType > > eliminatePartialMultifrontal(const Ordering &ordering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
Do multifrontal elimination of some variables, in ordering provided, to produce a Bayes tree and a re...
Definition EliminateableFactorGraph-inst.h:193
EliminationTraits< FactorGraphType > EliminationTraitsType
Definition EliminateableFactorGraph.h:67
std::pair< boost::shared_ptr< BayesTreeType >, boost::shared_ptr< FactorGraphType > > eliminatePartialMultifrontal(const KeyVector &variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
Do multifrontal elimination of the given variables in an ordering computed by COLAMD to produce a Bay...
Definition EliminateableFactorGraph-inst.h:212
boost::optional< Ordering::OrderingType > OptionalOrderingType
Definition EliminateableFactorGraph.h:95