ISAM2-impl.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 
21 #include <gtsam/nonlinear/ISAM2.h>
23 
24 #include <gtsam/base/debug.h>
25 #include <gtsam/inference/JunctionTree-inst.h> // We need the inst file because we'll make a special JT templated on ISAM2
26 #include <gtsam/inference/Symbol.h>
30 
31 #include <boost/range/adaptors.hpp>
32 #include <boost/range/algorithm/copy.hpp>
33 namespace br {
34 using namespace boost::range;
35 using namespace boost::adaptors;
36 } // namespace br
37 
38 #include <algorithm>
39 #include <limits>
40 #include <string>
41 #include <utility>
42 
43 namespace gtsam {
44 
45 /* ************************************************************************* */
46 // Special BayesTree class that uses ISAM2 cliques - this is the result of
47 // reeliminating ISAM2 subtrees.
48 class ISAM2BayesTree : public ISAM2::Base {
49  public:
50  typedef ISAM2::Base Base;
52  typedef boost::shared_ptr<This> shared_ptr;
53 
55 };
56 
57 /* ************************************************************************* */
58 // Special JunctionTree class that produces ISAM2 BayesTree cliques, used for
59 // reeliminating ISAM2 subtrees.
61  : public JunctionTree<ISAM2BayesTree, GaussianFactorGraph> {
62  public:
65  typedef boost::shared_ptr<This> shared_ptr;
66 
67  explicit ISAM2JunctionTree(const GaussianEliminationTree& eliminationTree)
68  : Base(eliminationTree) {}
69 };
70 
71 /* ************************************************************************* */
72 struct GTSAM_EXPORT DeltaImpl {
73  struct GTSAM_EXPORT PartialSolveResult {
75  };
76 
77  struct GTSAM_EXPORT ReorderingMode {
79  enum { /*AS_ADDED,*/ COLAMD } algorithm;
80  enum { NO_CONSTRAINT, CONSTRAIN_LAST } constrain;
81  boost::optional<FastMap<Key, int> > constrainedKeys;
82  };
83 
87  static size_t UpdateGaussNewtonDelta(const ISAM2::Roots& roots,
88  const KeySet& replacedKeys,
89  double wildfireThreshold,
91 
96  static size_t UpdateRgProd(const ISAM2::Roots& roots,
97  const KeySet& replacedKeys,
98  const VectorValues& gradAtZero,
99  VectorValues* RgProd);
100 
104  static VectorValues ComputeGradientSearch(const VectorValues& gradAtZero,
105  const VectorValues& RgProd);
106 };
107 
108 /* ************************************************************************* */
114 struct GTSAM_EXPORT UpdateImpl {
117  UpdateImpl(const ISAM2Params& params, const ISAM2UpdateParams& updateParams)
118  : params_(params), updateParams_(updateParams) {}
119 
120  // Provide some debugging information at the start of update
121  static void LogStartingUpdate(const NonlinearFactorGraph& newFactors,
122  const ISAM2& isam2) {
123  gttic(pushBackFactors);
124  const bool debug = ISDEBUG("ISAM2 update");
125  const bool verbose = ISDEBUG("ISAM2 update verbose");
126 
127  if (verbose) {
128  std::cout << "ISAM2::update\n";
129  isam2.print("ISAM2: ");
130  }
131 
132  if (debug || verbose) {
133  newFactors.print("The new factors are: ");
134  }
135  }
136 
137  // Check relinearization if we're at the nth step, or we are using a looser
138  // loop relinerization threshold.
139  bool relinarizationNeeded(size_t update_count) const {
140  return updateParams_.force_relinearize ||
141  (params_.enableRelinearization &&
142  update_count % params_.relinearizeSkip == 0);
143  }
144 
145  // Add any new factors \Factors:=\Factors\cup\Factors'.
146  void pushBackFactors(const NonlinearFactorGraph& newFactors,
147  NonlinearFactorGraph* nonlinearFactors,
148  GaussianFactorGraph* linearFactors,
149  VariableIndex* variableIndex,
150  FactorIndices* newFactorsIndices,
151  KeySet* keysWithRemovedFactors) const {
152  gttic(pushBackFactors);
153 
154  // Perform the first part of the bookkeeping updates for adding new factors.
155  // Adds them to the complete list of nonlinear factors, and populates the
156  // list of new factor indices, both optionally finding and reusing empty
157  // factor slots.
158  *newFactorsIndices = nonlinearFactors->add_factors(
159  newFactors, params_.findUnusedFactorSlots);
160 
161  // Remove the removed factors
162  NonlinearFactorGraph removedFactors;
163  removedFactors.reserve(updateParams_.removeFactorIndices.size());
164  for (const auto index : updateParams_.removeFactorIndices) {
165  removedFactors.push_back(nonlinearFactors->at(index));
166  nonlinearFactors->remove(index);
167  if (params_.cacheLinearizedFactors) linearFactors->remove(index);
168  }
169 
170  // Remove removed factors from the variable index so we do not attempt to
171  // relinearize them
172  variableIndex->remove(updateParams_.removeFactorIndices.begin(),
173  updateParams_.removeFactorIndices.end(),
174  removedFactors);
175  *keysWithRemovedFactors = removedFactors.keys();
176  }
177 
178  // Get keys from removed factors and new factors, and compute unused keys,
179  // i.e., keys that are empty now and do not appear in the new factors.
180  void computeUnusedKeys(const NonlinearFactorGraph& newFactors,
181  const VariableIndex& variableIndex,
182  const KeySet& keysWithRemovedFactors,
183  KeySet* unusedKeys) const {
184  gttic(computeUnusedKeys);
185  KeySet removedAndEmpty;
186  for (Key key : keysWithRemovedFactors) {
187  if (variableIndex.empty(key))
188  removedAndEmpty.insert(removedAndEmpty.end(), key);
189  }
190  KeySet newFactorSymbKeys = newFactors.keys();
191  std::set_difference(removedAndEmpty.begin(), removedAndEmpty.end(),
192  newFactorSymbKeys.begin(), newFactorSymbKeys.end(),
193  std::inserter(*unusedKeys, unusedKeys->end()));
194  }
195 
196  // Calculate nonlinear error
197  void error(const NonlinearFactorGraph& nonlinearFactors,
198  const Values& estimate, boost::optional<double>* result) const {
199  gttic(error);
200  result->reset(nonlinearFactors.error(estimate));
201  }
202 
203  // Mark linear update
204  void gatherInvolvedKeys(const NonlinearFactorGraph& newFactors,
205  const NonlinearFactorGraph& nonlinearFactors,
206  const KeySet& keysWithRemovedFactors,
207  KeySet* markedKeys) const {
208  gttic(gatherInvolvedKeys);
209  *markedKeys = newFactors.keys(); // Get keys from new factors
210  // Also mark keys involved in removed factors
211  markedKeys->insert(keysWithRemovedFactors.begin(),
212  keysWithRemovedFactors.end());
213 
214  // Also mark any provided extra re-eliminate keys
215  if (updateParams_.extraReelimKeys) {
216  for (Key key : *updateParams_.extraReelimKeys) {
217  markedKeys->insert(key);
218  }
219  }
220 
221  // Also, keys that were not observed in existing factors, but whose affected
222  // keys have been extended now (e.g. smart factors)
223  if (updateParams_.newAffectedKeys) {
224  for (const auto& factorAddedKeys : *updateParams_.newAffectedKeys) {
225  const auto factorIdx = factorAddedKeys.first;
226  const auto& affectedKeys = nonlinearFactors.at(factorIdx)->keys();
227  markedKeys->insert(affectedKeys.begin(), affectedKeys.end());
228  }
229  }
230  }
231 
232  // Update detail, unused, and observed keys from markedKeys
233  void updateKeys(const KeySet& markedKeys, ISAM2Result* result) const {
234  gttic(updateKeys);
235  // Observed keys for detailed results
236  if (result->detail && params_.enableDetailedResults) {
237  for (Key key : markedKeys) {
238  result->detail->variableStatus[key].isObserved = true;
239  }
240  }
241 
242  for (Key index : markedKeys) {
243  // Only add if not unused
244  if (result->unusedKeys.find(index) == result->unusedKeys.end())
245  // Make a copy of these, as we'll soon add to them
246  result->observedKeys.push_back(index);
247  }
248  }
249 
251  const FastMap<char, Vector>& thresholds, const VectorValues& delta,
252  const ISAM2::sharedClique& clique, KeySet* relinKeys) {
253  // Check the current clique for relinearization
254  bool relinearize = false;
255  for (Key var : *clique->conditional()) {
256  // Find the threshold for this variable type
257  const Vector& threshold = thresholds.find(Symbol(var).chr())->second;
258 
259  const Vector& deltaVar = delta[var];
260 
261  // Verify the threshold vector matches the actual variable size
262  if (threshold.rows() != deltaVar.rows())
263  throw std::invalid_argument(
264  "Relinearization threshold vector dimensionality for '" +
265  std::string(1, Symbol(var).chr()) +
266  "' passed into iSAM2 parameters does not match actual variable "
267  "dimensionality.");
268 
269  // Check for relinearization
270  if ((deltaVar.array().abs() > threshold.array()).any()) {
271  relinKeys->insert(var);
272  relinearize = true;
273  }
274  }
275 
276  // If this node was relinearized, also check its children
277  if (relinearize) {
278  for (const ISAM2::sharedClique& child : clique->children) {
279  CheckRelinearizationRecursiveMap(thresholds, delta, child, relinKeys);
280  }
281  }
282  }
283 
285  double threshold, const VectorValues& delta,
286  const ISAM2::sharedClique& clique, KeySet* relinKeys) {
287  // Check the current clique for relinearization
288  bool relinearize = false;
289  for (Key var : *clique->conditional()) {
290  double maxDelta = delta[var].lpNorm<Eigen::Infinity>();
291  if (maxDelta >= threshold) {
292  relinKeys->insert(var);
293  relinearize = true;
294  }
295  }
296 
297  // If this node was relinearized, also check its children
298  if (relinearize) {
299  for (const ISAM2::sharedClique& child : clique->children) {
300  CheckRelinearizationRecursiveDouble(threshold, delta, child, relinKeys);
301  }
302  }
303  }
304 
319  const ISAM2::Roots& roots, const VectorValues& delta,
320  const ISAM2Params::RelinearizationThreshold& relinearizeThreshold) {
321  KeySet relinKeys;
322  for (const ISAM2::sharedClique& root : roots) {
323  if (relinearizeThreshold.type() == typeid(double))
324  CheckRelinearizationRecursiveDouble(
325  boost::get<double>(relinearizeThreshold), delta, root, &relinKeys);
326  else if (relinearizeThreshold.type() == typeid(FastMap<char, Vector>))
327  CheckRelinearizationRecursiveMap(
328  boost::get<FastMap<char, Vector> >(relinearizeThreshold), delta,
329  root, &relinKeys);
330  }
331  return relinKeys;
332  }
333 
346  const VectorValues& delta,
347  const ISAM2Params::RelinearizationThreshold& relinearizeThreshold) {
348  KeySet relinKeys;
349 
350  if (const double* threshold = boost::get<double>(&relinearizeThreshold)) {
351  for (const VectorValues::KeyValuePair& key_delta : delta) {
352  double maxDelta = key_delta.second.lpNorm<Eigen::Infinity>();
353  if (maxDelta >= *threshold) relinKeys.insert(key_delta.first);
354  }
355  } else if (const FastMap<char, Vector>* thresholds =
356  boost::get<FastMap<char, Vector> >(&relinearizeThreshold)) {
357  for (const VectorValues::KeyValuePair& key_delta : delta) {
358  const Vector& threshold =
359  thresholds->find(Symbol(key_delta.first).chr())->second;
360  if (threshold.rows() != key_delta.second.rows())
361  throw std::invalid_argument(
362  "Relinearization threshold vector dimensionality for '" +
363  std::string(1, Symbol(key_delta.first).chr()) +
364  "' passed into iSAM2 parameters does not match actual variable "
365  "dimensionality.");
366  if ((key_delta.second.array().abs() > threshold.array()).any())
367  relinKeys.insert(key_delta.first);
368  }
369  }
370 
371  return relinKeys;
372  }
373 
374  // Mark keys in \Delta above threshold \beta:
376  const VectorValues& delta,
377  const KeySet& fixedVariables,
378  KeySet* markedKeys) const {
379  gttic(gatherRelinearizeKeys);
380  // J=\{\Delta_{j}\in\Delta|\Delta_{j}\geq\beta\}.
381  KeySet relinKeys =
383  ? CheckRelinearizationPartial(roots, delta,
384  params_.relinearizeThreshold)
385  : CheckRelinearizationFull(delta, params_.relinearizeThreshold);
386  if (updateParams_.forceFullSolve)
387  relinKeys = CheckRelinearizationFull(delta, 0.0); // for debugging
388 
389  // Remove from relinKeys any keys whose linearization points are fixed
390  for (Key key : fixedVariables) {
391  relinKeys.erase(key);
392  }
393  if (updateParams_.noRelinKeys) {
394  for (Key key : *updateParams_.noRelinKeys) {
395  relinKeys.erase(key);
396  }
397  }
398 
399  // Add the variables being relinearized to the marked keys
400  markedKeys->insert(relinKeys.begin(), relinKeys.end());
401  return relinKeys;
402  }
403 
404  // Record relinerization threshold keys in detailed results
405  void recordRelinearizeDetail(const KeySet& relinKeys,
407  if (detail && params_.enableDetailedResults) {
408  for (Key key : relinKeys) {
409  detail->variableStatus[key].isAboveRelinThreshold = true;
410  detail->variableStatus[key].isRelinearized = true;
411  }
412  }
413  }
414 
415  // Mark all cliques that involve marked variables \Theta_{J} and all
416  // their ancestors.
417  void findFluid(const ISAM2::Roots& roots, const KeySet& relinKeys,
418  KeySet* markedKeys,
420  gttic(findFluid);
421  for (const auto& root : roots)
422  // add other cliques that have the marked ones in the separator
423  root->findAll(relinKeys, markedKeys);
424 
425  // Relinearization-involved keys for detailed results
426  if (detail && params_.enableDetailedResults) {
427  KeySet involvedRelinKeys;
428  for (const auto& root : roots)
429  root->findAll(relinKeys, &involvedRelinKeys);
430  for (Key key : involvedRelinKeys) {
431  if (!detail->variableStatus[key].isAboveRelinThreshold) {
432  detail->variableStatus[key].isRelinearizeInvolved = true;
433  detail->variableStatus[key].isRelinearized = true;
434  }
435  }
436  }
437  }
438 
444  static void ExpmapMasked(const VectorValues& delta, const KeySet& mask,
445  Values* theta) {
446  gttic(ExpmapMasked);
447  assert(theta->size() == delta.size());
448  Values::iterator key_value;
450 #ifdef GTSAM_USE_TBB
451  for (key_value = theta->begin(); key_value != theta->end(); ++key_value) {
452  key_delta = delta.find(key_value->key);
453 #else
454  for (key_value = theta->begin(), key_delta = delta.begin();
455  key_value != theta->end(); ++key_value, ++key_delta) {
456  assert(key_value->key == key_delta->first);
457 #endif
458  Key var = key_value->key;
459  assert(static_cast<size_t>(delta[var].size()) == key_value->value.dim());
460  assert(delta[var].allFinite());
461  if (mask.exists(var)) {
462  Value* retracted = key_value->value.retract_(delta[var]);
463  key_value->value = *retracted;
464  retracted->deallocate_();
465  }
466  }
467  }
468 
469  // Linearize new factors
471  const Values& theta, size_t numNonlinearFactors,
472  const FactorIndices& newFactorsIndices,
473  GaussianFactorGraph* linearFactors) const {
474  gttic(linearizeNewFactors);
475  auto linearized = newFactors.linearize(theta);
476  if (params_.findUnusedFactorSlots) {
477  linearFactors->resize(numNonlinearFactors);
478  for (size_t i = 0; i < newFactors.size(); ++i)
479  (*linearFactors)[newFactorsIndices[i]] = (*linearized)[i];
480  } else {
481  linearFactors->push_back(*linearized);
482  }
483  assert(linearFactors->size() == numNonlinearFactors);
484  }
485 
487  const FactorIndices& newFactorsIndices,
488  VariableIndex* variableIndex) const {
489  gttic(augmentVariableIndex);
490  // Augment the variable index with the new factors
491  if (params_.findUnusedFactorSlots)
492  variableIndex->augment(newFactors, newFactorsIndices);
493  else
494  variableIndex->augment(newFactors);
495 
496  // Augment it with existing factors which now affect to more variables:
497  if (updateParams_.newAffectedKeys) {
498  for (const auto& factorAddedKeys : *updateParams_.newAffectedKeys) {
499  const auto factorIdx = factorAddedKeys.first;
500  variableIndex->augmentExistingFactor(factorIdx, factorAddedKeys.second);
501  }
502  }
503  }
504 
505  static void LogRecalculateKeys(const ISAM2Result& result) {
506  const bool debug = ISDEBUG("ISAM2 recalculate");
507 
508  if (debug) {
509  std::cout << "markedKeys: ";
510  for (const Key key : result.markedKeys) {
511  std::cout << key << " ";
512  }
513  std::cout << std::endl;
514  std::cout << "observedKeys: ";
515  for (const Key key : result.observedKeys) {
516  std::cout << key << " ";
517  }
518  std::cout << std::endl;
519  }
520  }
521 
523  const VariableIndex& variableIndex) {
524  gttic(GetAffectedFactors);
525  FactorIndexSet indices;
526  for (const Key key : keys) {
527  const FactorIndices& factors(variableIndex[key]);
528  indices.insert(factors.begin(), factors.end());
529  }
530  return indices;
531  }
532 
533  // find intermediate (linearized) factors from cache that are passed into
534  // the affected area
536  const ISAM2::Cliques& orphans) {
537  GaussianFactorGraph cachedBoundary;
538 
539  for (const auto& orphan : orphans) {
540  // retrieve the cached factor and add to boundary
541  cachedBoundary.push_back(orphan->cachedFactor());
542  }
543 
544  return cachedBoundary;
545  }
546 };
547 
548 } // namespace gtsam
iterator find(Key j)
Definition: VectorValues.h:235
size_t size() const
Definition: FactorGraph.h:306
static void LogRecalculateKeys(const ISAM2Result &result)
Definition: ISAM2-impl.h:505
bool empty(Key variable) const
Return true if no factors associated with a variable.
Definition: VariableIndex.h:98
boost::optional< FastList< Key > > extraReelimKeys
Global debugging flags.
void augment(const FG &factors, boost::optional< const FactorIndices & > newFactorIndices=boost::none)
unsigned char chr() const
KeySet keys() const
static GaussianFactorGraph GetCachedBoundaryFactors(const ISAM2::Cliques &orphans)
Definition: ISAM2-impl.h:535
FastVector< FactorIndex > FactorIndices
Define collection types:
Definition: Factor.h:32
FactorIndices add_factors(const CONTAINER &factors, bool useEmptySlots=false)
static FactorIndexSet GetAffectedFactors(const KeyList &keys, const VariableIndex &variableIndex)
Definition: ISAM2-impl.h:522
size_t size() const
Definition: VectorValues.h:125
const ISAM2UpdateParams & updateParams_
Definition: ISAM2-impl.h:116
GaussianFactorGraph factors(list_of(factor1)(factor2)(factor3))
void remove(size_t i)
Definition: FactorGraph.h:362
virtual void deallocate_() const =0
static void CheckRelinearizationRecursiveMap(const FastMap< char, Vector > &thresholds, const VectorValues &delta, const ISAM2::sharedClique &clique, KeySet *relinKeys)
Definition: ISAM2-impl.h:250
IsDerived< DERIVEDFACTOR > push_back(boost::shared_ptr< DERIVEDFACTOR > factor)
Add a factor directly using a shared_ptr.
Definition: FactorGraph.h:166
virtual Value * retract_(const Vector &delta) const =0
const mpreal root(const mpreal &x, unsigned long int k, mp_rnd_t r=mpreal::get_default_rnd())
Definition: mpreal.h:2194
Rot2 theta
bool exists(const VALUE &e) const
Definition: FastSet.h:98
void computeUnusedKeys(const NonlinearFactorGraph &newFactors, const VariableIndex &variableIndex, const KeySet &keysWithRemovedFactors, KeySet *unusedKeys) const
Definition: ISAM2-impl.h:180
void error(const NonlinearFactorGraph &nonlinearFactors, const Values &estimate, boost::optional< double > *result) const
Definition: ISAM2-impl.h:197
void pushBackFactors(const NonlinearFactorGraph &newFactors, NonlinearFactorGraph *nonlinearFactors, GaussianFactorGraph *linearFactors, VariableIndex *variableIndex, FactorIndices *newFactorsIndices, KeySet *keysWithRemovedFactors) const
Definition: ISAM2-impl.h:146
const bool verbose
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
#define gttic(label)
Definition: timing.h:280
void augmentExistingFactor(const FactorIndex factorIndex, const KeySet &newKeys)
const ISAM2Params & params_
Definition: ISAM2-impl.h:115
void remove(ITERATOR firstFactor, ITERATOR lastFactor, const FG &factors)
static void CheckRelinearizationRecursiveDouble(double threshold, const VectorValues &delta, const ISAM2::sharedClique &clique, KeySet *relinKeys)
Definition: ISAM2-impl.h:284
#define ISDEBUG(S)
Definition: debug.h:60
Eigen::VectorXd Vector
Definition: Vector.h:38
void updateKeys(const KeySet &markedKeys, ISAM2Result *result) const
Definition: ISAM2-impl.h:233
size_t size() const
Definition: Values.h:236
Values result
ISAM2JunctionTree(const GaussianEliminationTree &eliminationTree)
Definition: ISAM2-impl.h:67
KeyVector observedKeys
Definition: ISAM2Result.h:105
UpdateImpl(const ISAM2Params &params, const ISAM2UpdateParams &updateParams)
Definition: ISAM2-impl.h:117
Class that stores detailed iSAM2 result.
Incremental update functionality (ISAM2) for BayesTree, with fluid relinearization.
const_iterator end() const
Definition: Values.h:242
static KeySet CheckRelinearizationPartial(const ISAM2::Roots &roots, const VectorValues &delta, const ISAM2Params::RelinearizationThreshold &relinearizeThreshold)
Definition: ISAM2-impl.h:318
void recordRelinearizeDetail(const KeySet &relinKeys, ISAM2Result::DetailedResults *detail) const
Definition: ISAM2-impl.h:405
boost::shared_ptr< This > shared_ptr
Definition: ISAM2-impl.h:65
ISAM2::Base Base
Definition: ISAM2-impl.h:50
static bool debug
StatusMap variableStatus
The status of each variable during this update, see VariableStatus.
Definition: ISAM2Result.h:153
value_type KeyValuePair
Typedef to pair<Key, Vector>
Definition: VectorValues.h:85
Base::sharedClique sharedClique
Shared pointer to a clique.
Definition: ISAM2.h:103
Values::const_iterator const_iterator
Const iterator over vector values.
Definition: VectorValues.h:82
static SmartStereoProjectionParams params
const_iterator begin() const
Definition: Values.h:241
bool relinarizationNeeded(size_t update_count) const
Definition: ISAM2-impl.h:139
RelinearizationThreshold relinearizeThreshold
Definition: ISAM2Params.h:168
traits
Definition: chartTesting.h:28
ISAM2BayesTree This
Definition: ISAM2-impl.h:51
boost::shared_ptr< This > shared_ptr
Definition: ISAM2-impl.h:52
const sharedFactor at(size_t i) const
Definition: FactorGraph.h:315
void print(const std::string &str="NonlinearFactorGraph: ", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
static KeySet CheckRelinearizationFull(const VectorValues &delta, const ISAM2Params::RelinearizationThreshold &relinearizeThreshold)
Definition: ISAM2-impl.h:345
boost::optional< FastMap< Key, int > > constrainedKeys
Definition: ISAM2-impl.h:81
FactorIndices removeFactorIndices
bool enablePartialRelinearizationCheck
Definition: ISAM2Params.h:218
KeySet gatherRelinearizeKeys(const ISAM2::Roots &roots, const VectorValues &delta, const KeySet &fixedVariables, KeySet *markedKeys) const
Definition: ISAM2-impl.h:375
void linearizeNewFactors(const NonlinearFactorGraph &newFactors, const Values &theta, size_t numNonlinearFactors, const FactorIndices &newFactorsIndices, GaussianFactorGraph *linearFactors) const
Definition: ISAM2-impl.h:470
The junction tree, template bodies.
void findFluid(const ISAM2::Roots &roots, const KeySet &relinKeys, KeySet *markedKeys, ISAM2Result::DetailedResults *detail) const
Definition: ISAM2-impl.h:417
void resize(size_t size)
Definition: FactorGraph.h:358
static double error
Definition: testRot3.cpp:39
FastVector< sharedClique > Roots
Definition: BayesTree.h:93
void reserve(size_t size)
Definition: FactorGraph.h:162
boost::variant< double, FastMap< char, Vector > > RelinearizationThreshold
Definition: ISAM2Params.h:140
static void ExpmapMasked(const VectorValues &delta, const KeySet &mask, Values *theta)
Definition: ISAM2-impl.h:444
double error(const Values &values) const
const KeyVector keys
Container::iterator get(Container &c, Position position)
void augmentVariableIndex(const NonlinearFactorGraph &newFactors, const FactorIndices &newFactorsIndices, VariableIndex *variableIndex) const
Definition: ISAM2-impl.h:486
boost::shared_ptr< GaussianFactorGraph > linearize(const Values &linearizationPoint) const
Linearize a nonlinear factor graph.
boost::optional< FastList< Key > > noRelinKeys
iterator begin()
Iterator over variables.
Definition: VectorValues.h:226
boost::optional< FastMap< FactorIndex, KeySet > > newAffectedKeys
ISAM2JunctionTree This
Definition: ISAM2-impl.h:64
Gaussian Bayes Tree, the result of eliminating a GaussianJunctionTree.
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:61
JunctionTree< ISAM2BayesTree, GaussianFactorGraph > Base
Definition: ISAM2-impl.h:63
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
boost::optional< DetailedResults > detail
Definition: ISAM2Result.h:158
const int Infinity
Definition: Constants.h:31
static void LogStartingUpdate(const NonlinearFactorGraph &newFactors, const ISAM2 &isam2)
Definition: ISAM2-impl.h:121
void gatherInvolvedKeys(const NonlinearFactorGraph &newFactors, const NonlinearFactorGraph &nonlinearFactors, const KeySet &keysWithRemovedFactors, KeySet *markedKeys) const
Definition: ISAM2-impl.h:204


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:18