EliminateableFactorGraph-inst.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
19 #pragma once
20 
23 
24 namespace gtsam {
25 
26  /* ************************************************************************* */
27  template<class FACTORGRAPH>
28  std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesNetType>
30  OptionalOrderingType orderingType, const Eliminate& function,
31  OptionalVariableIndex variableIndex) const {
32  if(!variableIndex) {
33  // If no VariableIndex provided, compute one and call this function again IMPORTANT: we check
34  // for no variable index first so that it's always computed if we need to call COLAMD because
35  // no Ordering is provided. When removing optional from VariableIndex, create VariableIndex
36  // before creating ordering.
37  VariableIndex computedVariableIndex(asDerived());
38  return eliminateSequential(orderingType, function, std::cref(computedVariableIndex));
39  }
40  else {
41  // Compute an ordering and call this function again. We are guaranteed to have a
42  // VariableIndex already here because we computed one if needed in the previous 'if' block.
43  if (orderingType == Ordering::METIS) {
44  Ordering computedOrdering = Ordering::Metis(asDerived());
45  return eliminateSequential(computedOrdering, function, variableIndex);
46  } else if (orderingType == Ordering::COLAMD) {
47  Ordering computedOrdering = Ordering::Colamd((*variableIndex).get());
48  return eliminateSequential(computedOrdering, function, variableIndex);
49  } else if (orderingType == Ordering::NATURAL) {
50  Ordering computedOrdering = Ordering::Natural(asDerived());
51  return eliminateSequential(computedOrdering, function, variableIndex);
52  } else {
53  Ordering computedOrdering = EliminationTraitsType::DefaultOrderingFunc(
54  asDerived(), *variableIndex);
55  return eliminateSequential(computedOrdering, function, variableIndex);
56  }
57  }
58  }
59 
60  /* ************************************************************************* */
61  template<class FACTORGRAPH>
62  std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesNetType>
64  const Ordering& ordering, const Eliminate& function,
65  OptionalVariableIndex variableIndex) const
66  {
67  if(!variableIndex) {
68  // If no VariableIndex provided, compute one and call this function again
69  VariableIndex computedVariableIndex(asDerived());
70  return eliminateSequential(ordering, function, std::cref(computedVariableIndex));
71  } else {
72  gttic(eliminateSequential);
73  // Do elimination
74  EliminationTreeType etree(asDerived(), (*variableIndex).get(), ordering);
75  const auto [bayesNet, factorGraph] = etree.eliminate(function);
76  // If any factors are remaining, the ordering was incomplete
77  if(!factorGraph->empty()) {
78  throw InconsistentEliminationRequested(factorGraph->keys());
79  }
80  // Return the Bayes net
81  return bayesNet;
82  }
83  }
84 
85  /* ************************************************************************* */
86  template <class FACTORGRAPH>
87  std::shared_ptr<
90  OptionalOrderingType orderingType, const Eliminate& function,
91  OptionalVariableIndex variableIndex) const {
92  if (!variableIndex) {
93  // If no VariableIndex provided, compute one and call this function again
94  // IMPORTANT: we check for no variable index first so that it's always
95  // computed if we need to call COLAMD because no Ordering is provided.
96  // When removing optional from VariableIndex, create VariableIndex before
97  // creating ordering.
98  VariableIndex computedVariableIndex(asDerived());
99  return eliminateMultifrontal(orderingType, function,
100  std::cref(computedVariableIndex));
101  } else {
102  // Compute an ordering and call this function again. We are guaranteed to
103  // have a VariableIndex already here because we computed one if needed in
104  // the previous 'if' block.
105  if (orderingType == Ordering::METIS) {
106  Ordering computedOrdering = Ordering::Metis(asDerived());
107  return eliminateMultifrontal(computedOrdering, function, variableIndex);
108  } else if (orderingType == Ordering::COLAMD) {
109  Ordering computedOrdering = Ordering::Colamd((*variableIndex).get());
110  return eliminateMultifrontal(computedOrdering, function, variableIndex);
111  } else if (orderingType == Ordering::NATURAL) {
112  Ordering computedOrdering = Ordering::Natural(asDerived());
113  return eliminateMultifrontal(computedOrdering, function, variableIndex);
114  } else {
115  Ordering computedOrdering = EliminationTraitsType::DefaultOrderingFunc(
116  asDerived(), *variableIndex);
117  return eliminateMultifrontal(computedOrdering, function, variableIndex);
118  }
119  }
120  }
121 
122  /* ************************************************************************* */
123  template<class FACTORGRAPH>
124  std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesTreeType>
126  const Ordering& ordering, const Eliminate& function,
127  OptionalVariableIndex variableIndex) const
128  {
129  if(!variableIndex) {
130  // If no VariableIndex provided, compute one and call this function again
131  VariableIndex computedVariableIndex(asDerived());
132  return eliminateMultifrontal(ordering, function, std::cref(computedVariableIndex));
133  } else {
134  gttic(eliminateMultifrontal);
135  // Do elimination with given ordering
136  EliminationTreeType etree(asDerived(), (*variableIndex).get(), ordering);
137  JunctionTreeType junctionTree(etree);
138  const auto [bayesTree, factorGraph] = junctionTree.eliminate(function);
139  // If any factors are remaining, the ordering was incomplete
140  if(!factorGraph->empty()) {
141  throw InconsistentEliminationRequested(factorGraph->keys());
142  }
143  // Return the Bayes tree
144  return bayesTree;
145  }
146  }
147 
148  /* ************************************************************************* */
149  template<class FACTORGRAPH>
150  std::pair<std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesNetType>, std::shared_ptr<FACTORGRAPH> >
152  const Ordering& ordering, const Eliminate& function, OptionalVariableIndex variableIndex) const
153  {
154  if(variableIndex) {
155  gttic(eliminatePartialSequential);
156  // Do elimination
157  EliminationTreeType etree(asDerived(), (*variableIndex).get(), ordering);
158  return etree.eliminate(function);
159  } else {
160  // If no variable index is provided, compute one and call this function again
161  VariableIndex computedVariableIndex(asDerived());
162  return eliminatePartialSequential(ordering, function, std::cref(computedVariableIndex));
163  }
164  }
165 
166  /* ************************************************************************* */
167  template<class FACTORGRAPH>
168  std::pair<std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesNetType>, std::shared_ptr<FACTORGRAPH> >
170  const KeyVector& variables, const Eliminate& function, OptionalVariableIndex variableIndex) const
171  {
172  if(variableIndex) {
173  gttic(eliminatePartialSequential);
174  // Compute full ordering
175  Ordering fullOrdering = Ordering::ColamdConstrainedFirst((*variableIndex).get(), variables);
176 
177  // Split off the part of the ordering for the variables being eliminated
178  Ordering ordering(fullOrdering.begin(), fullOrdering.begin() + variables.size());
179  return eliminatePartialSequential(ordering, function, variableIndex);
180  } else {
181  // If no variable index is provided, compute one and call this function again
182  VariableIndex computedVariableIndex(asDerived());
183  return eliminatePartialSequential(variables, function, std::cref(computedVariableIndex));
184  }
185  }
186 
187  /* ************************************************************************* */
188  template<class FACTORGRAPH>
189  std::pair<std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesTreeType>, std::shared_ptr<FACTORGRAPH> >
191  const Ordering& ordering, const Eliminate& function, OptionalVariableIndex variableIndex) const
192  {
193  if(variableIndex) {
194  gttic(eliminatePartialMultifrontal);
195  // Do elimination
196  EliminationTreeType etree(asDerived(), (*variableIndex).get(), ordering);
197  JunctionTreeType junctionTree(etree);
198  return junctionTree.eliminate(function);
199  } else {
200  // If no variable index is provided, compute one and call this function again
201  VariableIndex computedVariableIndex(asDerived());
202  return eliminatePartialMultifrontal(ordering, function, std::cref(computedVariableIndex));
203  }
204  }
205 
206  /* ************************************************************************* */
207  template<class FACTORGRAPH>
208  std::pair<std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesTreeType>, std::shared_ptr<FACTORGRAPH> >
210  const KeyVector& variables, const Eliminate& function, OptionalVariableIndex variableIndex) const
211  {
212  if(variableIndex) {
213  gttic(eliminatePartialMultifrontal);
214  // Compute full ordering
215  Ordering fullOrdering = Ordering::ColamdConstrainedFirst((*variableIndex).get(), variables);
216 
217  // Split off the part of the ordering for the variables being eliminated
218  Ordering ordering(fullOrdering.begin(), fullOrdering.begin() + variables.size());
219  return eliminatePartialMultifrontal(ordering, function, variableIndex);
220  } else {
221  // If no variable index is provided, compute one and call this function again
222  VariableIndex computedVariableIndex(asDerived());
223  return eliminatePartialMultifrontal(variables, function, std::cref(computedVariableIndex));
224  }
225  }
226 
227  /* ************************************************************************* */
228  template<class FACTORGRAPH>
229  std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesNetType>
231  const Ordering& variables,
232  const Eliminate& function, OptionalVariableIndex variableIndex) const
233  {
234  if(!variableIndex) {
235  // If no variable index is provided, compute one and call this function again
236  VariableIndex index(asDerived());
237  return marginalMultifrontalBayesNet(variables, function, std::cref(index));
238  } else {
239  // No ordering was provided for the marginalized variables, so order them using constrained
240  // COLAMD.
241  constexpr bool forceOrder = true;
242  Ordering totalOrdering =
243  Ordering::ColamdConstrainedLast((*variableIndex).get(), variables, forceOrder);
244 
245  // Split up ordering
246  const size_t nVars = variables.size();
247  Ordering marginalizationOrdering(totalOrdering.begin(), totalOrdering.end() - nVars);
248  Ordering marginalVarsOrdering(totalOrdering.end() - nVars, totalOrdering.end());
249 
250  // Call this function again with the computed orderings
251  return marginalMultifrontalBayesNet(marginalVarsOrdering, marginalizationOrdering, function, variableIndex);
252  }
253  }
254 
255  /* ************************************************************************* */
256  template<class FACTORGRAPH>
257  std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesNetType>
259  const KeyVector& variables,
260  const Eliminate& function, OptionalVariableIndex variableIndex) const
261  {
262  if(!variableIndex) {
263  // If no variable index is provided, compute one and call this function again
264  VariableIndex index(asDerived());
265  return marginalMultifrontalBayesNet(variables, function, std::cref(index));
266  } else {
267  // No ordering was provided for the marginalized variables, so order them using constrained
268  // COLAMD.
269  const constexpr bool forceOrder = false;
270  Ordering totalOrdering =
271  Ordering::ColamdConstrainedLast((*variableIndex).get(), variables, forceOrder);
272 
273  // Split up ordering
274  const size_t nVars = variables.size();
275  Ordering marginalizationOrdering(totalOrdering.begin(), totalOrdering.end() - nVars);
276  Ordering marginalVarsOrdering(totalOrdering.end() - nVars, totalOrdering.end());
277 
278  // Call this function again with the computed orderings
279  return marginalMultifrontalBayesNet(marginalVarsOrdering, marginalizationOrdering, function, variableIndex);
280  }
281  }
282 
283  /* ************************************************************************* */
284  template<class FACTORGRAPH>
285  std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesNetType>
287  const Ordering& variables,
288  const Ordering& marginalizedVariableOrdering,
289  const Eliminate& function, OptionalVariableIndex variableIndex) const
290  {
291  if(!variableIndex) {
292  // If no variable index is provided, compute one and call this function again
293  VariableIndex index(asDerived());
294  return marginalMultifrontalBayesNet(variables, marginalizedVariableOrdering, function, index);
295  } else {
296  gttic(marginalMultifrontalBayesNet);
297  // An ordering was provided for the marginalized variables, so we can first eliminate them
298  // in the order requested.
299  const auto [bayesTree, factorGraph] =
300  eliminatePartialMultifrontal(marginalizedVariableOrdering, function, variableIndex);
301 
302  // An ordering was also provided for the unmarginalized variables, so we can also
303  // eliminate them in the order requested.
304  return factorGraph->eliminateSequential(variables, function);
305  }
306  }
307 
308  /* ************************************************************************* */
309  template<class FACTORGRAPH>
310  std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesNetType>
312  const KeyVector& variables,
313  const Ordering& marginalizedVariableOrdering,
314  const Eliminate& function, OptionalVariableIndex variableIndex) const
315  {
316  if(!variableIndex) {
317  // If no variable index is provided, compute one and call this function again
318  VariableIndex index(asDerived());
319  return marginalMultifrontalBayesNet(variables, marginalizedVariableOrdering, function, index);
320  } else {
321  gttic(marginalMultifrontalBayesNet);
322  // An ordering was provided for the marginalized variables, so we can first eliminate them
323  // in the order requested.
324  const auto [bayesTree, factorGraph] =
325  eliminatePartialMultifrontal(marginalizedVariableOrdering, function, variableIndex);
326 
327  // No ordering was provided for the unmarginalized variables, so order them with COLAMD.
328  return factorGraph->eliminateSequential(Ordering::COLAMD, function);
329  }
330  }
331 
332  /* ************************************************************************* */
333  template<class FACTORGRAPH>
334  std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesTreeType>
336  const Ordering& variables,
337  const Eliminate& function, OptionalVariableIndex variableIndex) const
338  {
339  if(!variableIndex) {
340  // If no variable index is provided, compute one and call this function again
341  VariableIndex computedVariableIndex(asDerived());
342  return marginalMultifrontalBayesTree(variables, function, std::cref(computedVariableIndex));
343  } else {
344  // No ordering was provided for the marginalized variables, so order them using constrained
345  // COLAMD.
346  constexpr bool forceOrder = true;
347  Ordering totalOrdering =
348  Ordering::ColamdConstrainedLast((*variableIndex).get(), variables, forceOrder);
349 
350  // Split up ordering
351  const size_t nVars = variables.size();
352  Ordering marginalizationOrdering(totalOrdering.begin(), totalOrdering.end() - nVars);
353  Ordering marginalVarsOrdering(totalOrdering.end() - nVars, totalOrdering.end());
354 
355  // Call this function again with the computed orderings
356  return marginalMultifrontalBayesTree(marginalVarsOrdering, marginalizationOrdering, function, variableIndex);
357  }
358  }
359 
360  /* ************************************************************************* */
361  template<class FACTORGRAPH>
362  std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesTreeType>
364  const KeyVector& variables,
365  const Eliminate& function, OptionalVariableIndex variableIndex) const
366  {
367  if(!variableIndex) {
368  // If no variable index is provided, compute one and call this function again
369  VariableIndex computedVariableIndex(asDerived());
370  return marginalMultifrontalBayesTree(variables, function, std::cref(computedVariableIndex));
371  } else {
372  // No ordering was provided for the marginalized variables, so order them using constrained
373  // COLAMD.
374  constexpr bool forceOrder = false;
375  Ordering totalOrdering =
376  Ordering::ColamdConstrainedLast((*variableIndex).get(), variables, forceOrder);
377 
378  // Split up ordering
379  const size_t nVars = variables.size();
380  Ordering marginalizationOrdering(totalOrdering.begin(), totalOrdering.end() - nVars);
381  Ordering marginalVarsOrdering(totalOrdering.end() - nVars, totalOrdering.end());
382 
383  // Call this function again with the computed orderings
384  return marginalMultifrontalBayesTree(marginalVarsOrdering, marginalizationOrdering, function, variableIndex);
385  }
386  }
387 
388  /* ************************************************************************* */
389  template<class FACTORGRAPH>
390  std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesTreeType>
392  const Ordering& variables,
393  const Ordering& marginalizedVariableOrdering,
394  const Eliminate& function, OptionalVariableIndex variableIndex) const
395  {
396  if(!variableIndex) {
397  // If no variable index is provided, compute one and call this function again
398  VariableIndex computedVariableIndex(asDerived());
399  return marginalMultifrontalBayesTree(variables, marginalizedVariableOrdering, function, std::cref(computedVariableIndex));
400  } else {
401  gttic(marginalMultifrontalBayesTree);
402  // An ordering was provided for the marginalized variables, so we can first eliminate them
403  // in the order requested.
404  const auto [bayesTree, factorGraph] =
405  eliminatePartialMultifrontal(marginalizedVariableOrdering, function, variableIndex);
406 
407  // An ordering was also provided for the unmarginalized variables, so we can also
408  // eliminate them in the order requested.
409  return factorGraph->eliminateMultifrontal(variables, function);
410  }
411  }
412 
413  /* ************************************************************************* */
414  template<class FACTORGRAPH>
415  std::shared_ptr<typename EliminateableFactorGraph<FACTORGRAPH>::BayesTreeType>
417  const KeyVector& variables,
418  const Ordering& marginalizedVariableOrdering,
419  const Eliminate& function, OptionalVariableIndex variableIndex) const
420  {
421  if(!variableIndex) {
422  // If no variable index is provided, compute one and call this function again
423  VariableIndex computedVariableIndex(asDerived());
424  return marginalMultifrontalBayesTree(variables, marginalizedVariableOrdering, function, std::cref(computedVariableIndex));
425  } else {
426  gttic(marginalMultifrontalBayesTree);
427  // An ordering was provided for the marginalized variables, so we can first eliminate them
428  // in the order requested.
429  const auto [bayesTree, factorGraph] =
430  eliminatePartialMultifrontal(marginalizedVariableOrdering, function, variableIndex);
431 
432  // No ordering was provided for the unmarginalized variables, so order them with COLAMD.
433  return factorGraph->eliminateMultifrontal(Ordering::COLAMD, function);
434  }
435  }
436 
437  /* ************************************************************************* */
438  template<class FACTORGRAPH>
439  std::shared_ptr<FACTORGRAPH>
441  const KeyVector& variables,
442  const Eliminate& function, OptionalVariableIndex variableIndex) const
443  {
444  if(variableIndex)
445  {
446  // Compute a total ordering for all variables
447  Ordering totalOrdering = Ordering::ColamdConstrainedLast((*variableIndex).get(), variables);
448 
449  // Split out the part for the marginalized variables
450  Ordering marginalizationOrdering(totalOrdering.begin(), totalOrdering.end() - variables.size());
451 
452  // Eliminate and return the remaining factor graph
453  return eliminatePartialMultifrontal(marginalizationOrdering, function, variableIndex).second;
454  }
455  else
456  {
457  // If no variable index is provided, compute one and call this function again
458  VariableIndex computedVariableIndex(asDerived());
459  return marginal(variables, function, std::cref(computedVariableIndex));
460  }
461  }
462 
463 
464 }
gtsam::EliminateableFactorGraph::eliminatePartialMultifrontal
std::pair< std::shared_ptr< BayesTreeType >, std::shared_ptr< FactorGraphType > > eliminatePartialMultifrontal(const Ordering &ordering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const
Definition: EliminateableFactorGraph-inst.h:190
gtsam::Ordering::ColamdConstrainedLast
static Ordering ColamdConstrainedLast(const FACTOR_GRAPH &graph, const KeyVector &constrainLast, bool forceOrder=false)
Definition: inference/Ordering.h:112
gtsam::EliminateableFactorGraph::eliminateSequential
std::shared_ptr< BayesNetType > eliminateSequential(OptionalOrderingType orderingType={}, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const
Definition: EliminateableFactorGraph-inst.h:29
gtsam::Ordering::Metis
static Ordering Metis(const MetisIndex &met)
Compute an ordering determined by METIS from a VariableIndex.
Definition: Ordering.cpp:210
gtsam::EliminateableFactorGraph::marginalMultifrontalBayesNet
std::shared_ptr< BayesNetType > marginalMultifrontalBayesNet(const Ordering &variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const
Definition: EliminateableFactorGraph-inst.h:230
gtsam::EliminateableFactorGraph::marginal
std::shared_ptr< FactorGraphType > marginal(const KeyVector &variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const
Definition: EliminateableFactorGraph-inst.h:440
gtsam::Ordering::NATURAL
@ NATURAL
Definition: inference/Ordering.h:41
gtsam::KeyVector
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:92
gtsam::EliminateableFactorGraph::eliminateMultifrontal
std::shared_ptr< BayesTreeType > eliminateMultifrontal(OptionalOrderingType orderingType={}, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const
Definition: EliminateableFactorGraph-inst.h:89
gtsam::EliminateableFactorGraph< GaussianFactorGraph >::OptionalVariableIndex
std::optional< std::reference_wrapper< const VariableIndex > > OptionalVariableIndex
Definition: EliminateableFactorGraph.h:92
gtsam::EliminateableFactorGraph< GaussianFactorGraph >::EliminationTreeType
EliminationTraitsType::EliminationTreeType EliminationTreeType
Elimination tree type that can do sequential elimination of this graph.
Definition: EliminateableFactorGraph.h:75
different_sigmas::bayesNet
const HybridBayesNet bayesNet
Definition: testHybridBayesNet.cpp:242
gtsam::EliminateableFactorGraph< GaussianFactorGraph >::JunctionTreeType
EliminationTraitsType::JunctionTreeType JunctionTreeType
Junction tree type that can do multifrontal elimination of this graph.
Definition: EliminateableFactorGraph.h:81
gtsam::Ordering::ColamdConstrainedFirst
static Ordering ColamdConstrainedFirst(const FACTOR_GRAPH &graph, const KeyVector &constrainFirst, bool forceOrder=false)
Definition: inference/Ordering.h:139
gtsam::EliminateableFactorGraph::eliminatePartialSequential
std::pair< std::shared_ptr< BayesNetType >, std::shared_ptr< FactorGraphType > > eliminatePartialSequential(const Ordering &ordering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const
Definition: EliminateableFactorGraph-inst.h:151
gtsam::Ordering::Colamd
static Ordering Colamd(const FACTOR_GRAPH &graph)
Definition: inference/Ordering.h:93
gtsam::EliminateableFactorGraph::BayesTreeType
EliminationTraitsType::BayesTreeType BayesTreeType
Bayes tree type produced by multifrontal elimination.
Definition: EliminateableFactorGraph.h:78
inferenceExceptions.h
Exceptions that may be thrown by inference algorithms.
gtsam::InconsistentEliminationRequested
Definition: inferenceExceptions.h:31
EliminateableFactorGraph.h
Variable elimination algorithms for factor graphs.
gtsam::VariableIndex
Definition: VariableIndex.h:41
ordering
static enum @1096 ordering
gtsam
traits
Definition: SFMdata.h:40
gtsam::Ordering::METIS
@ METIS
Definition: inference/Ordering.h:41
gtsam::EliminateableFactorGraph< GaussianFactorGraph >::OptionalOrderingType
std::optional< Ordering::OrderingType > OptionalOrderingType
Typedef for an optional ordering type.
Definition: EliminateableFactorGraph.h:95
gtsam::EliminateableFactorGraph< GaussianFactorGraph >::Eliminate
std::function< EliminationResult(const FactorGraphType &, const Ordering &)> Eliminate
The function type that does a single dense elimination step on a subgraph.
Definition: EliminateableFactorGraph.h:88
gtsam::Ordering::Natural
static Ordering Natural(const FACTOR_GRAPH &fg)
Return a natural Ordering. Typically used by iterative solvers.
Definition: inference/Ordering.h:188
gtsam::Ordering
Definition: inference/Ordering.h:33
gtsam::Ordering::COLAMD
@ COLAMD
Definition: inference/Ordering.h:41
gtsam::EliminateableFactorGraph::marginalMultifrontalBayesTree
std::shared_ptr< BayesTreeType > marginalMultifrontalBayesTree(const Ordering &variables, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const
Definition: EliminateableFactorGraph-inst.h:335
gttic
#define gttic(label)
Definition: timing.h:295


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:32:29