120 virtual bool equals(
const ISAM2& other,
double tol = 1e-9)
const;
159 const std::optional<FastList<Key> >& noRelinKeys = {},
160 const std::optional<FastList<Key> >& extraReelimKeys = {},
161 bool force_relinearize =
false);
181 virtual ISAM2Result update(
const NonlinearFactorGraph& newFactors,
182 const Values& newTheta,
183 const ISAM2UpdateParams& updateParams);
202 void marginalizeLeaves(
203 const FastList<Key>& leafKeys,
204 FactorIndices* marginalFactorsIndices =
nullptr,
205 FactorIndices* deletedFactorsIndices =
nullptr);
211 template <
class... OptArgs>
213 OptArgs&&... optArgs) {
223 std::pair<FactorIndices, FactorIndices> marginalizeLeavesWithIndices(
const FastList<Key>& leafKeys);
236 Values calculateEstimate()
const;
244 template <
class VALUE>
246 const Vector& delta =
getDelta()[key];
250#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V43
265 const Value& calculateEstimate(
Key key)
const;
278 Matrix marginalInformation(
Key key)
const;
281 Matrix marginalCovariance(
Key key)
const;
295 Values calculateBestEstimate()
const;
314 const ISAM2Params& params()
const {
return params_; }
319 size_t treeNnz()
const;
345 std::pair<KeySet, bool> predictUpdateInfo(
364 const KeySet& relinKeys);
378 const KeySet& relinKeys,
380 KeySet* affectedKeysSet, Cliques* orphans,
388 void addVariables(
const Values& newTheta,
394 void removeVariables(
const KeySet& unusedKeys);
398 void updateDelta(
bool forceFullSolve =
false)
const;
401#if GTSAM_ENABLE_BOOST_SERIALIZATION
403 friend class boost::serialization::access;
404 template<
class ARCHIVE>
405 void serialize(ARCHIVE & ar,
const unsigned int ) {
406 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
407 ar & BOOST_SERIALIZATION_NVP(theta_);
408 ar & BOOST_SERIALIZATION_NVP(variableIndex_);
409 ar & BOOST_SERIALIZATION_NVP(delta_);
410 ar & BOOST_SERIALIZATION_NVP(deltaNewton_);
411 ar & BOOST_SERIALIZATION_NVP(RgProd_);
412 ar & BOOST_SERIALIZATION_NVP(deltaReplacedMask_);
413 ar & BOOST_SERIALIZATION_NVP(nonlinearFactors_);
414 ar & BOOST_SERIALIZATION_NVP(linearFactors_);
415 ar & BOOST_SERIALIZATION_NVP(doglegDelta_);
416 ar & BOOST_SERIALIZATION_NVP(fixedVariables_);
417 ar & BOOST_SERIALIZATION_NVP(update_count_);
Gaussian Bayes Tree, the result of eliminating a GaussianJunctionTree.
Specialized iSAM2 Clique.
Factor Graph consisting of non-linear factors.
Class that stores detailed iSAM2 result.
Class that stores extra params for ISAM2::update().
Global functions in a separate testing namespace.
Definition chartTesting.h:28
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition Key.h:91
FastVector< FactorIndex > FactorIndices
Define collection types:
Definition Factor.h:37
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
FastList is a thin wrapper around std::list that uses the boost fast_pool_allocator instead of the de...
Definition FastList.h:43
FastMap is a thin wrapper around std::map that uses the boost fast_pool_allocator instead of the defa...
Definition FastMap.h:40
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition Group.h:37
Template to create a binary predicate.
Definition Testable.h:112
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:152
This is the base class for any type to be stored in Values.
Definition Value.h:39
std::shared_ptr< Clique > sharedClique
Definition BayesTree.h:84
BayesTree()
Definition BayesTree.h:119
FastList< sharedClique > Cliques
Definition BayesTree.h:99
ISAM2Clique Clique
Definition BayesTree.h:83
BayesTreeCliqueData getCliqueData() const
The VariableIndex class computes and stores the block column structure of a factor graph.
Definition VariableIndex.h:41
A Linear Factor Graph is a factor graph where all factors are Gaussian, i.e.
Definition GaussianFactorGraph.h:77
A class to store and access a joint marginal, returned from Gaussian and nonlinear covariance query A...
Definition JointMarginal.h:34
VectorValues represents a collection of vector-valued variables associated each with a unique integer...
Definition VectorValues.h:73
This is a base class for the various HMF2 implementations.
Definition IncrementalFixedLagSmoother.h:36
Implementation of the full ISAM2 algorithm for incremental nonlinear optimization.
Definition ISAM2.h:45
KeySet fixedVariables_
Set of variables that are involved with linear factors from marginalized variables and thus cannot ha...
Definition ISAM2.h:94
KeySet deltaReplacedMask_
A cumulative mask for the variables that were replaced and have not yet been updated in the linear so...
Definition ISAM2.h:76
void marginalizeLeaves(const FastList< Key > &leafKeys, FactorIndices *marginalFactorsIndices=nullptr, FactorIndices *deletedFactorsIndices=nullptr)
Marginalize out variables listed in leafKeys.
Definition ISAM2.cpp:556
int update_count_
Counter incremented every update(), used to determine periodic relinearization.
Definition ISAM2.h:96
BayesTree< ISAM2Clique > Base
The BayesTree base class.
Definition ISAM2.h:104
VALUE calculateEstimate(Key key) const
Compute an estimate for a single variable using its incomplete linear delta computed during the last ...
Definition ISAM2.h:245
virtual ~ISAM2()
default virtual destructor
Definition ISAM2.h:117
const KeySet & getFixedVariables() const
Access the nonlinear variable index.
Definition ISAM2.h:312
const VectorValues & getDelta() const
Access the current delta, computed during the last call to update.
Definition ISAM2.cpp:959
Base::Cliques Cliques
List of Cliques.
Definition ISAM2.h:107
Base::Clique Clique
A clique.
Definition ISAM2.h:105
void printStats() const
prints out clique statistics
Definition ISAM2.h:322
NonlinearFactorGraph nonlinearFactors_
All original nonlinear factors are stored here to use during relinearization.
Definition ISAM2.h:81
void marginalizeLeaves(const FastList< Key > &leafKeys, OptArgs &&... optArgs)
An overload of marginalizeLeaves that takes references to vectors instead of pointers to vectors and ...
Definition ISAM2.h:212
const VariableIndex & getVariableIndex() const
Access the nonlinear variable index.
Definition ISAM2.h:309
Base::sharedClique sharedClique
Shared pointer to a clique.
Definition ISAM2.h:106
VectorValues delta_
The linear delta from the last linear solution, an update to the estimate in theta.
Definition ISAM2.h:61
ISAM2(const ISAM2Params ¶ms)
Create an empty ISAM2 instance.
Definition ISAM2.cpp:45
VariableIndex variableIndex_
VariableIndex lets us look up factors by involved variable and keeps track of dimensions.
Definition ISAM2.h:52
const Values & getLinearizationPoint() const
Access the current linearization point.
Definition ISAM2.h:226
Values theta_
The current linearization point.
Definition ISAM2.h:48
ISAM2Params params_
The current parameters.
Definition ISAM2.h:87
size_t nnzAfterLastReorder_
Bayes tree nnz recorded after the most recent full batch reorder.
Definition ISAM2.h:99
GaussianFactorGraph linearFactors_
The current linear factors, which are only updated as needed.
Definition ISAM2.h:84
const NonlinearFactorGraph & getFactorsUnsafe() const
Access the set of nonlinear factors.
Definition ISAM2.h:304
ISAM2 This
This class.
Definition ISAM2.h:103
std::optional< double > doglegDelta_
The current Dogleg Delta (trust region radius).
Definition ISAM2.h:90
bool valueExists(Key key) const
Check whether variable with given key exists in linearization point.
Definition ISAM2.h:229
Definition ISAM2Params.h:199
This struct is returned from ISAM2::update() and contains information about the update that is useful...
Definition ISAM2Result.h:39
A struct holding detailed results, which must be enabled with ISAM2Params::enableDetailedResults.
Definition ISAM2Result.h:126
This struct is used by ISAM2::update() to pass additional parameters to give the user a fine-grained ...
Definition ISAM2UpdateParams.h:32
Definition NonlinearFactorGraph.h:57
A non-templated config holding any types of Manifold-group elements.
Definition Values.h:65