Public Types | Public Member Functions | Public Attributes | Private Member Functions | Friends | 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 boost::shared_ptr< Thisshared_ptr
 
typedef ConditionalType::shared_ptr sharedConditional
 
typedef ISAM2Clique This
 
typedef boost::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 boost::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...
 
virtual ~ISAM2Clique ()=default
 
- 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 boost::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...
 
template<class ARCHIVE >
void serialize (ARCHIVE &ar, const unsigned int)
 
bool valuesChanged (const KeySet &replaced, const Vector &originalValues, const VectorValues &delta, double threshold) const
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Member Functions inherited from gtsam::BayesTreeCliqueBase< ISAM2Clique, GaussianFactorGraph >
 BayesTreeCliqueBase ()
 
 BayesTreeCliqueBase (const sharedConditional &conditional)
 
 BayesTreeCliqueBase (const BayesTreeCliqueBase &c)
 
BayesTreeCliqueBaseoperator= (const BayesTreeCliqueBase &c)
 
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 >
boost::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

Definition at line 40 of file ISAM2Clique.h.

Definition at line 43 of file ISAM2Clique.h.

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

Definition at line 41 of file ISAM2Clique.h.

Definition at line 44 of file ISAM2Clique.h.

Definition at line 39 of file ISAM2Clique.h.

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

Definition at line 42 of file ISAM2Clique.h.

Constructor & Destructor Documentation

gtsam::ISAM2Clique::ISAM2Clique ( )
inline

Default constructor.

Definition at line 53 of file ISAM2Clique.h.

virtual gtsam::ISAM2Clique::~ISAM2Clique ( )
virtualdefault
gtsam::ISAM2Clique::ISAM2Clique ( const ISAM2Clique other)
inline

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

Definition at line 58 of file ISAM2Clique.h.

Member Function Documentation

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

Recursively add gradient at zero to g.

Definition at line 327 of file ISAM2Clique.cpp.

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

Access the cached factor

Definition at line 77 of file ISAM2Clique.h.

size_t gtsam::ISAM2Clique::calculate_nnz ( ) const

Definition at line 298 of file ISAM2Clique.cpp.

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

Definition at line 48 of file ISAM2Clique.cpp.

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.

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.

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

Access the gradient contribution.

Definition at line 80 of file ISAM2Clique.h.

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.

void gtsam::ISAM2Clique::markFrontalsAsChanged ( KeySet changed) const
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.

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 65 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.

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.

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.

template<class ARCHIVE >
void gtsam::ISAM2Clique::serialize ( ARCHIVE &  ar,
const unsigned  int 
)
inlineprivate

Definition at line 153 of file ISAM2Clique.h.

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.

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.

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Serialization function

Definition at line 151 of file ISAM2Clique.h.

Member Data Documentation

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.


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


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:58:17