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>
86 typedef std::pair<boost::shared_ptr<ConditionalType>, boost::shared_ptr<_FactorType> >
EliminationResult;
89 typedef boost::function<EliminationResult(const FactorGraphType&, const Ordering&)>
Eliminate;
117 boost::shared_ptr<BayesNetType> eliminateSequential(
118 OptionalOrderingType orderingType = boost::none,
119 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
120 OptionalVariableIndex variableIndex = boost::none)
const;
136 boost::shared_ptr<BayesNetType> eliminateSequential(
138 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
139 OptionalVariableIndex variableIndex = boost::none)
const;
157 boost::shared_ptr<BayesTreeType> eliminateMultifrontal(
158 OptionalOrderingType orderingType = boost::none,
159 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
160 OptionalVariableIndex variableIndex = boost::none)
const;
171 boost::shared_ptr<BayesTreeType> eliminateMultifrontal(
173 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
174 OptionalVariableIndex variableIndex = boost::none)
const;
180 std::pair<boost::shared_ptr<BayesNetType>, boost::shared_ptr<FactorGraphType> >
181 eliminatePartialSequential(
183 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
184 OptionalVariableIndex variableIndex = boost::none)
const;
190 std::pair<boost::shared_ptr<BayesNetType>, boost::shared_ptr<FactorGraphType> >
191 eliminatePartialSequential(
193 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
194 OptionalVariableIndex variableIndex = boost::none)
const;
200 std::pair<boost::shared_ptr<BayesTreeType>, boost::shared_ptr<FactorGraphType> >
201 eliminatePartialMultifrontal(
203 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
204 OptionalVariableIndex variableIndex = boost::none)
const;
210 std::pair<boost::shared_ptr<BayesTreeType>, boost::shared_ptr<FactorGraphType> >
211 eliminatePartialMultifrontal(
213 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
214 OptionalVariableIndex variableIndex = boost::none)
const;
225 boost::shared_ptr<BayesNetType> marginalMultifrontalBayesNet(
226 boost::variant<const Ordering&, const KeyVector&> variables,
227 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
228 OptionalVariableIndex variableIndex = boost::none)
const;
240 boost::shared_ptr<BayesNetType> marginalMultifrontalBayesNet(
241 boost::variant<const Ordering&, const KeyVector&> variables,
242 const Ordering& marginalizedVariableOrdering,
243 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
244 OptionalVariableIndex variableIndex = boost::none)
const;
255 boost::shared_ptr<BayesTreeType> marginalMultifrontalBayesTree(
256 boost::variant<const Ordering&, const KeyVector&> variables,
257 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
258 OptionalVariableIndex variableIndex = boost::none)
const;
270 boost::shared_ptr<BayesTreeType> marginalMultifrontalBayesTree(
271 boost::variant<const Ordering&, const KeyVector&> variables,
272 const Ordering& marginalizedVariableOrdering,
273 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
274 OptionalVariableIndex variableIndex = boost::none)
const;
277 boost::shared_ptr<FactorGraphType> marginal(
279 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
280 OptionalVariableIndex variableIndex = boost::none)
const;
285 const FactorGraphType&
asDerived()
const {
return static_cast<const FactorGraphType&
>(*this); }
288 FactorGraphType&
asDerived() {
return static_cast<FactorGraphType&
>(*this); }
294 const Eliminate&
function,
295 OptionalVariableIndex variableIndex,
296 OptionalOrderingType orderingType)
const {
297 return eliminateSequential(ordering,
function, variableIndex);
302 const Eliminate&
function,
303 OptionalVariableIndex variableIndex = boost::none,
304 OptionalOrderingType orderingType = boost::none)
const {
305 return eliminateSequential(orderingType,
function, variableIndex);
311 const Eliminate&
function,
312 OptionalVariableIndex variableIndex,
313 OptionalOrderingType orderingType)
const {
314 return eliminateMultifrontal(ordering,
function, variableIndex);
319 const Eliminate&
function,
320 OptionalVariableIndex variableIndex = boost::none,
321 OptionalOrderingType orderingType = boost::none)
const {
322 return eliminateMultifrontal(orderingType,
function, variableIndex);
327 boost::variant<const Ordering&, const KeyVector&> variables,
329 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
330 OptionalVariableIndex variableIndex = boost::none)
const {
331 return marginalMultifrontalBayesNet(variables,
function, variableIndex);
336 boost::variant<const Ordering&, const KeyVector&> variables,
338 const Eliminate&
function = EliminationTraitsType::DefaultEliminate,
339 OptionalVariableIndex variableIndex = boost::none)
const {
340 return marginalMultifrontalBayesTree(variables,
function, variableIndex);
boost::shared_ptr< BayesTreeType > eliminateMultifrontal(const Eliminate &function, OptionalVariableIndex variableIndex=boost::none, OptionalOrderingType orderingType=boost::none) const
EliminateableFactorGraph< FACTORGRAPH > This
Typedef to this class.
boost::shared_ptr< BayesTreeType > marginalMultifrontalBayesTree(boost::variant< const Ordering &, const KeyVector & > variables, boost::none_t, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
boost::shared_ptr< BayesTreeType > eliminateMultifrontal(const Ordering &ordering, const Eliminate &function, OptionalVariableIndex variableIndex, OptionalOrderingType orderingType) const
boost::shared_ptr< BayesNetType > marginalMultifrontalBayesNet(boost::variant< const Ordering &, const KeyVector & > variables, boost::none_t, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
static enum @843 ordering
EliminationTraitsType::ConditionalType ConditionalType
Conditional type stored in the Bayes net produced by elimination.
const FactorGraphType & asDerived() const
boost::optional< Ordering::OrderingType > OptionalOrderingType
Typedef for an optional ordering type.
FACTORGRAPH FactorGraphType
Typedef to factor graph type.
EliminationTraitsType::BayesNetType BayesNetType
Bayes net type produced by sequential elimination.
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
EliminationTraitsType::JunctionTreeType JunctionTreeType
Junction tree type that can do multifrontal elimination of this graph.
EliminationTraits< FactorGraphType >::FactorType _FactorType
EliminationTraitsType::EliminationTreeType EliminationTreeType
Elimination tree type that can do sequential elimination of this graph.
boost::function< EliminationResult(const FactorGraphType &, const Ordering &)> Eliminate
The function type that does a single dense elimination step on a subgraph.
FactorGraphType & asDerived()
EliminationTraits< FactorGraphType > EliminationTraitsType
Typedef to the specific EliminationTraits for this graph.
EliminationTraitsType::BayesTreeType BayesTreeType
Bayes tree type produced by multifrontal elimination.
std::pair< boost::shared_ptr< ConditionalType >, boost::shared_ptr< _FactorType > > EliminationResult
boost::shared_ptr< BayesNetType > eliminateSequential(const Ordering &ordering, const Eliminate &function, OptionalVariableIndex variableIndex, OptionalOrderingType orderingType) const
boost::shared_ptr< BayesNetType > eliminateSequential(const Eliminate &function, OptionalVariableIndex variableIndex=boost::none, OptionalOrderingType orderingType=boost::none) const
boost::optional< const VariableIndex & > OptionalVariableIndex
Typedef for an optional variable index as an argument to elimination functions.