#include <ISAM2Clique.h>
Public Types | |
typedef BayesTreeCliqueBase< This, GaussianFactorGraph > | Base |
typedef GaussianConditional | ConditionalType |
typedef std::shared_ptr< This > | shared_ptr |
typedef ConditionalType::shared_ptr | sharedConditional |
typedef ISAM2Clique | This |
typedef std::weak_ptr< This > | weak_ptr |
Public Types inherited from gtsam::BayesTreeCliqueBase< ISAM2Clique, GaussianFactorGraph > | |
typedef EliminationTraitsType::BayesNetType | BayesNetType |
typedef BayesNetType::ConditionalType | ConditionalType |
typedef FactorGraphType::Eliminate | Eliminate |
typedef GaussianFactorGraph | FactorGraphType |
typedef FactorGraphType::FactorType | FactorType |
typedef std::shared_ptr< ConditionalType > | sharedConditional |
Public Member Functions | |
void | addGradientAtZero (VectorValues *g) const |
Recursively add gradient at zero to g. More... | |
Base::FactorType::shared_ptr & | cachedFactor () |
size_t | calculate_nnz () const |
bool | equals (const This &other, double tol=1e-9) const |
void | findAll (const KeySet &markedMask, KeySet *keys) const |
const Vector & | gradientContribution () const |
Access the gradient contribution. More... | |
ISAM2Clique () | |
Default constructor. More... | |
ISAM2Clique (const ISAM2Clique &other) | |
void | nnz_internal (size_t *result) const |
ISAM2Clique & | operator= (const ISAM2Clique &other) |
void | optimizeWildfire (const KeySet &replaced, double threshold, KeySet *changed, VectorValues *delta, size_t *count) const |
bool | optimizeWildfireNode (const KeySet &replaced, double threshold, KeySet *changed, VectorValues *delta, size_t *count) const |
void | print (const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const override |
void | setEliminationResult (const FactorGraphType::EliminationResult &eliminationResult) |
Overridden to also store the remaining factor and gradient contribution. More... | |
Public Member Functions inherited from gtsam::BayesTreeCliqueBase< ISAM2Clique, GaussianFactorGraph > | |
void | setEliminationResult (const typename FactorGraphType::EliminationResult &eliminationResult) |
bool | equals (const ISAM2Clique &other, double tol=1e-9) const |
const sharedConditional & | conditional () const |
sharedConditional & | conditional () |
bool | isRoot () const |
Return true if this clique is the root of a Bayes tree. More... | |
size_t | nrChildren () const |
Return the number of children. More... | |
const derived_ptr | operator[] (size_t i) const |
Return the child at index i. More... | |
size_t | treeSize () const |
size_t | numCachedSeparatorMarginals () const |
derived_ptr | parent () const |
int | problemSize () const |
BayesNetType | shortcut (const derived_ptr &root, Eliminate function=EliminationTraitsType::DefaultEliminate) const |
FactorGraphType | separatorMarginal (Eliminate function=EliminationTraitsType::DefaultEliminate) const |
FactorGraphType | marginal2 (Eliminate function=EliminationTraitsType::DefaultEliminate) const |
void | deleteCachedShortcuts () |
const std::optional< FactorGraphType > & | cachedSeparatorMarginal () const |
Public Attributes | |
Base::FactorType::shared_ptr | cachedFactor_ |
Vector | gradientContribution_ |
Public Attributes inherited from gtsam::BayesTreeCliqueBase< ISAM2Clique, GaussianFactorGraph > | |
FastVector< derived_ptr > | children |
sharedConditional | conditional_ |
bool | is_root |
derived_weak_ptr | parent_ |
int | problemSize_ |
Private Member Functions | |
void | fastBackSubstitute (VectorValues *delta) const |
bool | isDirty (const KeySet &replaced, const KeySet &changed) const |
void | markFrontalsAsChanged (KeySet *changed) const |
Set changed flag for each frontal variable. More... | |
void | restoreFromOriginals (const Vector &originalValues, VectorValues *delta) const |
Restore delta to original values, guided by frontal keys. More... | |
bool | valuesChanged (const KeySet &replaced, const Vector &originalValues, const VectorValues &delta, double threshold) const |
Additional Inherited Members | |
Protected Member Functions inherited from gtsam::BayesTreeCliqueBase< ISAM2Clique, GaussianFactorGraph > | |
BayesTreeCliqueBase () | |
Default constructor. More... | |
BayesTreeCliqueBase (const sharedConditional &conditional) | |
BayesTreeCliqueBase (const BayesTreeCliqueBase &c) | |
Shallow copy constructor. More... | |
BayesTreeCliqueBase & | operator= (const BayesTreeCliqueBase &c) |
Shallow copy assignment constructor. More... | |
virtual | ~BayesTreeCliqueBase () |
KeyVector | separator_setminus_B (const derived_ptr &B) const |
Calculate set for shortcut calculations. More... | |
KeyVector | shortcut_indices (const derived_ptr &B, const FactorGraphType &p_Cp_B) const |
void | deleteCachedShortcutsNonRecursive () |
Protected Attributes inherited from gtsam::BayesTreeCliqueBase< ISAM2Clique, GaussianFactorGraph > | |
std::optional< FactorGraphType > | cachedSeparatorMarginal_ |
This stores the Cached separator marginal P(S) More... | |
std::mutex | cachedSeparatorMarginalMutex_ |
Specialized Clique structure for ISAM2, incorporating caching and gradient contribution TODO: more documentation
Definition at line 36 of file ISAM2Clique.h.
Definition at line 40 of file ISAM2Clique.h.
Definition at line 43 of file ISAM2Clique.h.
typedef std::shared_ptr<This> gtsam::ISAM2Clique::shared_ptr |
Definition at line 41 of file ISAM2Clique.h.
Definition at line 44 of file ISAM2Clique.h.
typedef ISAM2Clique gtsam::ISAM2Clique::This |
Definition at line 39 of file ISAM2Clique.h.
typedef std::weak_ptr<This> gtsam::ISAM2Clique::weak_ptr |
Definition at line 42 of file ISAM2Clique.h.
|
inline |
Default constructor.
Definition at line 53 of file ISAM2Clique.h.
|
inline |
Copy constructor, does not copy solution pointers as these are invalid in different trees.
Definition at line 57 of file ISAM2Clique.h.
void gtsam::ISAM2Clique::addGradientAtZero | ( | VectorValues * | g | ) | const |
Recursively add gradient at zero to g.
Definition at line 327 of file ISAM2Clique.cpp.
|
inline |
Access the cached factor
Definition at line 76 of file ISAM2Clique.h.
size_t gtsam::ISAM2Clique::calculate_nnz | ( | ) | const |
Definition at line 298 of file ISAM2Clique.cpp.
Definition at line 48 of file ISAM2Clique.cpp.
|
private |
Back-substitute - special version stores solution pointers in cliques for fast access.
Definition at line 97 of file ISAM2Clique.cpp.
Recursively search this clique and its children for marked keys appearing in the separator, and add the frontal keys of any cliques whose separator contains any marked keys to the set keys
. The purpose of this is to discover the cliques that need to be redone due to information propagating to them from cliques that directly contain factors being relinearized.
The original comment says this finds all variables directly connected to the marked ones by measurements. Is this true, because it seems like this would also pull in variables indirectly connected through other frontal or separator variables?
Alternatively could we trace up towards the root for each variable here?
Definition at line 305 of file ISAM2Clique.cpp.
|
inline |
Access the gradient contribution.
Definition at line 79 of file ISAM2Clique.h.
Check if clique was replaced, or if any parents were changed above the threshold or themselves replaced.
Definition at line 67 of file ISAM2Clique.cpp.
|
private |
Set changed flag for each frontal variable.
Definition at line 183 of file ISAM2Clique.cpp.
void gtsam::ISAM2Clique::nnz_internal | ( | size_t * | result | ) | const |
Starting from the root, add up entries of frontal and conditional matrices of each conditional
Definition at line 287 of file ISAM2Clique.cpp.
|
inline |
Assignment operator, does not copy solution pointers as these are invalid in different trees.
Definition at line 64 of file ISAM2Clique.h.
void gtsam::ISAM2Clique::optimizeWildfire | ( | const KeySet & | replaced, |
double | threshold, | ||
KeySet * | changed, | ||
VectorValues * | delta, | ||
size_t * | count | ||
) | const |
Definition at line 202 of file ISAM2Clique.cpp.
bool gtsam::ISAM2Clique::optimizeWildfireNode | ( | const KeySet & | replaced, |
double | threshold, | ||
KeySet * | changed, | ||
VectorValues * | delta, | ||
size_t * | count | ||
) | const |
Definition at line 236 of file ISAM2Clique.cpp.
|
overridevirtual |
print this node
Reimplemented from gtsam::BayesTreeCliqueBase< ISAM2Clique, GaussianFactorGraph >.
Definition at line 56 of file ISAM2Clique.cpp.
|
private |
Restore delta to original values, guided by frontal keys.
Definition at line 190 of file ISAM2Clique.cpp.
void gtsam::ISAM2Clique::setEliminationResult | ( | const FactorGraphType::EliminationResult & | eliminationResult | ) |
Overridden to also store the remaining factor and gradient contribution.
Definition at line 34 of file ISAM2Clique.cpp.
|
private |
Definition at line 171 of file ISAM2Clique.cpp.
Base::FactorType::shared_ptr gtsam::ISAM2Clique::cachedFactor_ |
Definition at line 46 of file ISAM2Clique.h.
Vector gtsam::ISAM2Clique::gradientContribution_ |
Definition at line 47 of file ISAM2Clique.h.