gtsam  4.0.0
gtsam
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 
18 #pragma once
19 
21 #include <gtsam/nonlinear/ISAM2.h>
22 
23 namespace gtsam {
24 
25 struct GTSAM_EXPORT ISAM2::Impl {
26 
27  struct GTSAM_EXPORT PartialSolveResult {
28  ISAM2::sharedClique bayesTree;
29  };
30 
31  struct GTSAM_EXPORT ReorderingMode {
32  size_t nFullSystemVars;
33  enum { /*AS_ADDED,*/ COLAMD } algorithm;
34  enum { NO_CONSTRAINT, CONSTRAIN_LAST } constrain;
35  boost::optional<FastMap<Key,int> > constrainedKeys;
36  };
37 
47  static void AddVariables(const Values& newTheta, Values& theta, VectorValues& delta,
48  VectorValues& deltaNewton, VectorValues& RgProd,
49  const KeyFormatter& keyFormatter = DefaultKeyFormatter);
50 
54  static void AddFactorsStep1(const NonlinearFactorGraph& newFactors, bool useUnusedSlots,
55  NonlinearFactorGraph& nonlinearFactors, FactorIndices& newFactorIndices);
56 
60  static void RemoveVariables(const KeySet& unusedKeys, const FastVector<ISAM2::sharedClique>& roots,
61  Values& theta, VariableIndex& variableIndex, VectorValues& delta, VectorValues& deltaNewton,
62  VectorValues& RgProd, KeySet& replacedKeys, Base::Nodes& nodes,
63  KeySet& fixedVariables);
64 
74  static KeySet CheckRelinearizationFull(const VectorValues& delta,
75  const ISAM2Params::RelinearizationThreshold& relinearizeThreshold);
76 
88  static KeySet CheckRelinearizationPartial(const FastVector<ISAM2::sharedClique>& roots,
89  const VectorValues& delta, const ISAM2Params::RelinearizationThreshold& relinearizeThreshold);
90 
106  static void FindAll(ISAM2Clique::shared_ptr clique, KeySet& keys, const KeySet& markedMask);
107 
121  static void ExpmapMasked(Values& values, const VectorValues& delta,
122  const KeySet& mask,
123  boost::optional<VectorValues&> invalidateIfDebug = boost::none,
124  const KeyFormatter& keyFormatter = DefaultKeyFormatter);
125 
129  static size_t UpdateGaussNewtonDelta(const FastVector<ISAM2::sharedClique>& roots,
130  const KeySet& replacedKeys, VectorValues& delta, double wildfireThreshold);
131 
136  static size_t UpdateRgProd(const ISAM2::Roots& roots, const KeySet& replacedKeys,
137  const VectorValues& gradAtZero, VectorValues& RgProd);
138 
142  static VectorValues ComputeGradientSearch(const VectorValues& gradAtZero,
143  const VectorValues& RgProd);
144 
145 };
146 
147 }
Base::sharedClique sharedClique
Shared pointer to a clique.
Definition: ISAM2.h:489
Definition: ISAM2-impl.h:25
boost::variant< double, FastMap< char, Vector > > RelinearizationThreshold
Either a constant relinearization threshold or a per-variable-type set of thresholds.
Definition: ISAM2.h:105
Gaussian Bayes Tree, the result of eliminating a GaussianJunctionTree.
A non-templated config holding any types of Manifold-group elements.
Definition: Values.h:70
The VariableIndex class computes and stores the block column structure of a factor graph...
Definition: VariableIndex.h:42
Definition: ISAM2-impl.h:31
Incremental update functionality (ISAM2) for BayesTree, with fluid relinearization.
This class represents a collection of vector-valued variables associated each with a unique integer i...
Definition: VectorValues.h:90
A non-linear factor graph is a graph of non-Gaussian, i.e.
Definition: NonlinearFactorGraph.h:77
Definition: ISAM2-impl.h:27
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
boost::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:33