21#include <boost/shared_ptr.hpp>
23#include <boost/variant.hpp>
24#include <boost/optional.hpp>
55 template<
class FACTORGRAPH>
60 typedef FACTORGRAPH 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,
277 boost::shared_ptr<FactorGraphType>
marginal(
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_V41
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
std::function< EliminationResult(const FactorGraphType &, const Ordering &)> Eliminate
The function type that does a single dense elimination step on a subgraph.
Definition: EliminateableFactorGraph.h:89
EliminationTraitsType::JunctionTreeType JunctionTreeType
Junction tree type that can do multifrontal elimination of this graph.
Definition: EliminateableFactorGraph.h:82
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:286
boost::optional< const VariableIndex & > OptionalVariableIndex
Typedef for an optional variable index as an argument to elimination functions.
Definition: EliminateableFactorGraph.h:92
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:353
EliminationTraitsType::EliminationTreeType EliminationTreeType
Elimination tree type that can do sequential elimination of this graph.
Definition: EliminateableFactorGraph.h:76
std::pair< boost::shared_ptr< ConditionalType >, boost::shared_ptr< _FactorType > > EliminationResult
The pair of conditional and remaining factor produced by a single dense elimination step on a subgrap...
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:84
EliminationTraits< FactorGraphType > EliminationTraitsType
Typedef to the specific EliminationTraits for this graph.
Definition: EliminateableFactorGraph.h:67
EliminationTraitsType::ConditionalType ConditionalType
Conditional type stored in the Bayes net produced by elimination.
Definition: EliminateableFactorGraph.h:70
boost::optional< Ordering::OrderingType > OptionalOrderingType
Typedef for an optional ordering type.
Definition: EliminateableFactorGraph.h:95
EliminationTraitsType::BayesTreeType BayesTreeType
Bayes tree type produced by multifrontal elimination.
Definition: EliminateableFactorGraph.h:79
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:140
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:219
EliminationTraitsType::BayesNetType BayesNetType
Bayes net type produced by sequential elimination.
Definition: EliminateableFactorGraph.h:73
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:179
Definition: Ordering.h:34