Public Types | Public Member Functions | Public Attributes | Private Member Functions | List of all members
gtsam::ISAM2Clique Class Reference

#include <ISAM2Clique.h>

Inheritance diagram for gtsam::ISAM2Clique:
Inheritance graph
[legend]

Public Types

typedef BayesTreeCliqueBase< This, GaussianFactorGraphBase
 
typedef GaussianConditional ConditionalType
 
typedef std::shared_ptr< Thisshared_ptr
 
typedef ConditionalType::shared_ptr sharedConditional
 
typedef ISAM2Clique This
 
typedef std::weak_ptr< Thisweak_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< ConditionalTypesharedConditional
 

Public Member Functions

void addGradientAtZero (VectorValues *g) const
 Recursively add gradient at zero to g. More...
 
Base::FactorType::shared_ptrcachedFactor ()
 
size_t calculate_nnz () const
 
bool equals (const This &other, double tol=1e-9) const
 
void findAll (const KeySet &markedMask, KeySet *keys) const
 
const VectorgradientContribution () const
 Access the gradient contribution. More...
 
 ISAM2Clique ()
 Default constructor. More...
 
 ISAM2Clique (const ISAM2Clique &other)
 
void nnz_internal (size_t *result) const
 
ISAM2Cliqueoperator= (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 sharedConditionalconditional () const
 
bool isRoot () const
 
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_ptrchildren
 
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...
 
BayesTreeCliqueBaseoperator= (const BayesTreeCliqueBase &c)
 Shallow copy assignment constructor. More...
 
virtual ~BayesTreeCliqueBase ()
 
KeyVector separator_setminus_B (const derived_ptr &B) const
 Calculate set $ S \setminus B $ 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< FactorGraphTypecachedSeparatorMarginal_
 This stores the Cached separator marginal P(S) More...
 
std::mutex cachedSeparatorMarginalMutex_
 

Detailed Description

Specialized Clique structure for ISAM2, incorporating caching and gradient contribution TODO: more documentation

Definition at line 36 of file ISAM2Clique.h.

Member Typedef Documentation

◆ Base

Definition at line 40 of file ISAM2Clique.h.

◆ ConditionalType

Definition at line 43 of file ISAM2Clique.h.

◆ shared_ptr

typedef std::shared_ptr<This> gtsam::ISAM2Clique::shared_ptr

Definition at line 41 of file ISAM2Clique.h.

◆ sharedConditional

Definition at line 44 of file ISAM2Clique.h.

◆ This

Definition at line 39 of file ISAM2Clique.h.

◆ weak_ptr

typedef std::weak_ptr<This> gtsam::ISAM2Clique::weak_ptr

Definition at line 42 of file ISAM2Clique.h.

Constructor & Destructor Documentation

◆ ISAM2Clique() [1/2]

gtsam::ISAM2Clique::ISAM2Clique ( )
inline

Default constructor.

Definition at line 53 of file ISAM2Clique.h.

◆ ISAM2Clique() [2/2]

gtsam::ISAM2Clique::ISAM2Clique ( const ISAM2Clique other)
inline

Copy constructor, does not copy solution pointers as these are invalid in different trees.

Definition at line 57 of file ISAM2Clique.h.

Member Function Documentation

◆ addGradientAtZero()

void gtsam::ISAM2Clique::addGradientAtZero ( VectorValues g) const

Recursively add gradient at zero to g.

Definition at line 327 of file ISAM2Clique.cpp.

◆ cachedFactor()

Base::FactorType::shared_ptr& gtsam::ISAM2Clique::cachedFactor ( )
inline

Access the cached factor

Definition at line 76 of file ISAM2Clique.h.

◆ calculate_nnz()

size_t gtsam::ISAM2Clique::calculate_nnz ( ) const

Definition at line 298 of file ISAM2Clique.cpp.

◆ equals()

bool gtsam::ISAM2Clique::equals ( const This other,
double  tol = 1e-9 
) const

Definition at line 48 of file ISAM2Clique.cpp.

◆ fastBackSubstitute()

void gtsam::ISAM2Clique::fastBackSubstitute ( VectorValues delta) const
private

Back-substitute - special version stores solution pointers in cliques for fast access.

Definition at line 97 of file ISAM2Clique.cpp.

◆ findAll()

void gtsam::ISAM2Clique::findAll ( const KeySet markedMask,
KeySet keys 
) const

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.

◆ gradientContribution()

const Vector& gtsam::ISAM2Clique::gradientContribution ( ) const
inline

Access the gradient contribution.

Definition at line 79 of file ISAM2Clique.h.

◆ isDirty()

bool gtsam::ISAM2Clique::isDirty ( const KeySet replaced,
const KeySet changed 
) const
private

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.

◆ markFrontalsAsChanged()

void gtsam::ISAM2Clique::markFrontalsAsChanged ( KeySet changed) const
private

Set changed flag for each frontal variable.

Definition at line 183 of file ISAM2Clique.cpp.

◆ nnz_internal()

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.

◆ operator=()

ISAM2Clique& gtsam::ISAM2Clique::operator= ( const ISAM2Clique other)
inline

Assignment operator, does not copy solution pointers as these are invalid in different trees.

Definition at line 64 of file ISAM2Clique.h.

◆ optimizeWildfire()

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.

◆ optimizeWildfireNode()

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.

◆ print()

void gtsam::ISAM2Clique::print ( const std::string &  s = "",
const KeyFormatter formatter = DefaultKeyFormatter 
) const
overridevirtual

print this node

Reimplemented from gtsam::BayesTreeCliqueBase< ISAM2Clique, GaussianFactorGraph >.

Definition at line 56 of file ISAM2Clique.cpp.

◆ restoreFromOriginals()

void gtsam::ISAM2Clique::restoreFromOriginals ( const Vector originalValues,
VectorValues delta 
) const
private

Restore delta to original values, guided by frontal keys.

Definition at line 190 of file ISAM2Clique.cpp.

◆ setEliminationResult()

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.

◆ valuesChanged()

bool gtsam::ISAM2Clique::valuesChanged ( const KeySet replaced,
const Vector originalValues,
const VectorValues delta,
double  threshold 
) const
private

Definition at line 171 of file ISAM2Clique.cpp.

Member Data Documentation

◆ cachedFactor_

Base::FactorType::shared_ptr gtsam::ISAM2Clique::cachedFactor_

Definition at line 46 of file ISAM2Clique.h.

◆ gradientContribution_

Vector gtsam::ISAM2Clique::gradientContribution_

Definition at line 47 of file ISAM2Clique.h.


The documentation for this class was generated from the following files:


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:46:22