21 #include <boost/shared_ptr.hpp> 22 #include <boost/function.hpp> 23 #include <boost/variant.hpp> 24 #include <boost/optional.hpp> 35 struct EliminationTraits
55 template<
class FACTORGRAPH>
60 typedef FACTORGRAPH FactorGraphType;
86 typedef std::pair<boost::shared_ptr<ConditionalType>, boost::shared_ptr<_FactorType> >
EliminationResult;
126 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
153 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
161 std::pair<boost::shared_ptr<BayesNetType>, boost::shared_ptr<FactorGraphType> >
164 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
171 std::pair<boost::shared_ptr<BayesNetType>, boost::shared_ptr<FactorGraphType> >
174 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
181 std::pair<boost::shared_ptr<BayesTreeType>, boost::shared_ptr<FactorGraphType> >
184 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
191 std::pair<boost::shared_ptr<BayesTreeType>, boost::shared_ptr<FactorGraphType> >
194 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
209 boost::variant<const Ordering&, const KeyVector&> variables,
211 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
226 boost::variant<const Ordering&, const KeyVector&> variables,
228 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
232 boost::shared_ptr<FactorGraphType>
marginal(
234 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
240 const FactorGraphType& asDerived()
const {
return static_cast<const FactorGraphType&>(*
this); }
243 FactorGraphType& asDerived() {
return static_cast<FactorGraphType&>(*
this); }
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:152
boost::shared_ptr< BayesNetType > eliminateSequential(OptionalOrdering ordering=boost::none, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none, OptionalOrderingType orderingType=boost::none) const
Do sequential elimination of all variables to produce a Bayes net.
Definition: EliminateableFactorGraph-inst.h:30
EliminateableFactorGraph is a base class for factor graphs that contains elimination algorithms.
Definition: EliminateableFactorGraph.h:56
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
Variable ordering for the elimination algorithm.
A Linear Factor Graph is a factor graph where all factors are Gaussian, i.e.
Definition: GaussianFactorGraph.h:65
EliminationTraitsType::ConditionalType ConditionalType
Conditional type stored in the Bayes net produced by elimination.
Definition: EliminateableFactorGraph.h:70
boost::optional< const Ordering & > OptionalOrdering
Typedef for an optional ordering as an argument to elimination functions.
Definition: EliminateableFactorGraph.h:92
boost::optional< Ordering::OrderingType > OptionalOrderingType
Typedef for an optional ordering type.
Definition: EliminateableFactorGraph.h:98
EliminationTraitsType::JunctionTreeType JunctionTreeType
Junction tree type that can do multifrontal elimination of this graph.
Definition: EliminateableFactorGraph.h:82
boost::optional< const VariableIndex & > OptionalVariableIndex
Typedef for an optional variable index as an argument to elimination functions.
Definition: EliminateableFactorGraph.h:95
EliminationTraitsType::EliminationTreeType EliminationTreeType
Elimination tree type that can do sequential elimination of this graph.
Definition: EliminateableFactorGraph.h:76
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:113
boost::shared_ptr< BayesTreeType > marginalMultifrontalBayesTree(boost::variant< const Ordering &, const KeyVector & > variables, OptionalOrdering marginalizedVariableOrdering=boost::none, 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:251
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:56
EliminationTraitsType::BayesTreeType BayesTreeType
Bayes tree type produced by multifrontal elimination.
Definition: EliminateableFactorGraph.h:79
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
boost::function< EliminationResult(const FactorGraphType &, const Ordering &)> Eliminate
The function type that does a single dense elimination step on a subgraph.
Definition: EliminateableFactorGraph.h:89
Definition: Ordering.h:34
Traits class for eliminateable factor graphs, specifies the types that result from elimination,...
Definition: BayesTreeCliqueBase.h:32
boost::shared_ptr< BayesNetType > marginalMultifrontalBayesNet(boost::variant< const Ordering &, const KeyVector & > variables, OptionalOrdering marginalizedVariableOrdering=boost::none, 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:192
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:310
boost::shared_ptr< BayesTreeType > eliminateMultifrontal(OptionalOrdering ordering=boost::none, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none, OptionalOrderingType orderingType=boost::none) const
Do multifrontal elimination of all variables to produce a Bayes tree.
Definition: EliminateableFactorGraph-inst.h:71
EliminationTraits< FactorGraphType > EliminationTraitsType
Typedef to the specific EliminationTraits for this graph.
Definition: EliminateableFactorGraph.h:67
EliminationTraitsType::BayesNetType BayesNetType
Bayes net type produced by sequential elimination.
Definition: EliminateableFactorGraph.h:73