gtsam 4.2.0
gtsam
gtsam::BayesTreeOrphanWrapper< HybridBayesTreeClique > Class Reference

Detailed Description

Class for Hybrid Bayes tree orphan subtrees.

This object stores parent keys in our base type factor so that eliminating those parent keys will pull this subtree into the elimination.

This is a template instantiation for hybrid Bayes tree cliques, storing both the regular keys and discrete keys in the HybridConditional.

+ Inheritance diagram for gtsam::BayesTreeOrphanWrapper< HybridBayesTreeClique >:

Public Member Functions

 BayesTreeOrphanWrapper (const boost::shared_ptr< CliqueType > &clique)
 Construct a new Bayes Tree Orphan Wrapper object. More...
 
void print (const std::string &s="", const KeyFormatter &formatter=DefaultKeyFormatter) const override
 print utility More...
 
- Public Member Functions inherited from gtsam::HybridConditional
 HybridConditional ()=default
 Default constructor needed for serialization.
 
 HybridConditional (const KeyVector &continuousKeys, const DiscreteKeys &discreteKeys, size_t nFrontals)
 Construct a new Hybrid Conditional object. More...
 
 HybridConditional (const KeyVector &continuousFrontals, const DiscreteKeys &discreteFrontals, const KeyVector &continuousParents, const DiscreteKeys &discreteParents)
 Construct a new Hybrid Conditional object. More...
 
 HybridConditional (const boost::shared_ptr< GaussianConditional > &continuousConditional)
 Construct a new Hybrid Conditional object. More...
 
 HybridConditional (const boost::shared_ptr< DiscreteConditional > &discreteConditional)
 Construct a new Hybrid Conditional object. More...
 
 HybridConditional (const boost::shared_ptr< GaussianMixture > &gaussianMixture)
 Construct a new Hybrid Conditional object. More...
 
void print (const std::string &s="Hybrid Conditional: ", const KeyFormatter &formatter=DefaultKeyFormatter) const override
 GTSAM-style print. More...
 
bool equals (const HybridFactor &other, double tol=1e-9) const override
 GTSAM-style equals. More...
 
GaussianMixture::shared_ptr asMixture () const
 Return HybridConditional as a GaussianMixture. More...
 
GaussianConditional::shared_ptr asGaussian () const
 Return HybridConditional as a GaussianConditional. More...
 
DiscreteConditional::shared_ptr asDiscrete () const
 Return conditional as a DiscreteConditional. More...
 
boost::shared_ptr< Factorinner () const
 Get the type-erased pointer to the inner type.
 
double error (const HybridValues &values) const override
 Return the error of the underlying conditional. More...
 
double logProbability (const HybridValues &values) const override
 Return the log-probability (or density) of the underlying conditional. More...
 
double logNormalizationConstant () const override
 Return the log normalization constant. More...
 
double evaluate (const HybridValues &values) const override
 Return the probability (or density) of the underlying conditional. More...
 
bool frontalsIn (const VectorValues &measurements) const
 Check if VectorValues measurements contains all frontal keys.
 
- Public Member Functions inherited from gtsam::HybridFactor
 HybridFactor ()=default
 Default constructor creates empty factor.
 
 HybridFactor (const KeyVector &keys)
 Construct hybrid factor from continuous keys. More...
 
 HybridFactor (const DiscreteKeys &discreteKeys)
 Construct hybrid factor from discrete keys. More...
 
 HybridFactor (const KeyVector &continuousKeys, const DiscreteKeys &discreteKeys)
 Construct a new Hybrid Factor object. More...
 
virtual ~HybridFactor ()=default
 Virtual destructor.
 
void print (const std::string &s="HybridFactor\n", const KeyFormatter &formatter=DefaultKeyFormatter) const override
 print More...
 
bool isDiscrete () const
 True if this is a factor of discrete variables only.
 
bool isContinuous () const
 True if this is a factor of continuous variables only.
 
bool isHybrid () const
 True is this is a Discrete-Continuous factor.
 
size_t nrContinuous () const
 Return the number of continuous variables in this factor.
 
const DiscreteKeysdiscreteKeys () const
 Return the discrete keys for this factor.
 
const KeyVectorcontinuousKeys () const
 Return only the continuous keys for this factor.
 
- Public Member Functions inherited from gtsam::Factor
virtual ~Factor ()=default
 Default destructor.
 
bool empty () const
 Whether the factor is empty (involves zero variables).
 
Key front () const
 First key.
 
Key back () const
 Last key.
 
const_iterator find (Key key) const
 find
 
const KeyVectorkeys () const
 Access the factor's involved variable keys.
 
const_iterator begin () const
 Iterator at beginning of involved variable keys.
 
const_iterator end () const
 Iterator at end of involved variable keys.
 
size_t size () const
 
virtual void printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
 print only keys More...
 
bool equals (const This &other, double tol=1e-9) const
 check equality
 
KeyVectorkeys ()
 
iterator begin ()
 Iterator at beginning of involved variable keys.
 
iterator end ()
 Iterator at end of involved variable keys.
 
- Public Member Functions inherited from gtsam::Conditional< HybridFactor, HybridConditional >
void print (const std::string &s="Conditional", const KeyFormatter &formatter=DefaultKeyFormatter) const
 print with optional formatter
 
bool equals (const This &c, double tol=1e-9) const
 check equality
 
virtual ~Conditional ()
 
size_t nrFrontals () const
 return the number of frontals
 
size_t nrParents () const
 return the number of parents
 
Key firstFrontalKey () const
 Convenience function to get the first frontal key.
 
Frontals frontals () const
 return a view of the frontal keys
 
Parents parents () const
 return a view of the parent keys
 
double operator() (const HybridValues &x) const
 Evaluate probability density, sugar.
 
double normalizationConstant () const
 Non-virtual, exponentiate logNormalizationConstant.
 
size_t & nrFrontals ()
 Mutable version of nrFrontals.
 
FACTOR::const_iterator beginFrontals () const
 Iterator pointing to first frontal key.
 
FACTOR::iterator beginFrontals ()
 Mutable iterator pointing to first frontal key.
 
FACTOR::const_iterator endFrontals () const
 Iterator pointing past the last frontal key.
 
FACTOR::iterator endFrontals ()
 Mutable iterator pointing past the last frontal key.
 
FACTOR::const_iterator beginParents () const
 Iterator pointing to the first parent key.
 
FACTOR::iterator beginParents ()
 Mutable iterator pointing to the first parent key.
 
FACTOR::const_iterator endParents () const
 Iterator pointing past the last parent key.
 
FACTOR::iterator endParents ()
 Mutable iterator pointing past the last parent key.
 

Public Attributes

boost::shared_ptr< CliqueTypeclique
 

Public Types

typedef HybridBayesTreeClique CliqueType
 
typedef HybridConditional Base
 
- Public Types inherited from gtsam::HybridConditional
typedef HybridConditional This
 Typedef to this class.
 
typedef boost::shared_ptr< Thisshared_ptr
 shared_ptr to this class
 
typedef HybridFactor BaseFactor
 Typedef to our factor base class.
 
typedef Conditional< BaseFactor, ThisBaseConditional
 Typedef to our conditional base class.
 
- Public Types inherited from gtsam::HybridFactor
typedef HybridFactor This
 This class.
 
typedef boost::shared_ptr< HybridFactorshared_ptr
 shared_ptr to this class
 
typedef Factor Base
 Our base class.
 
- Public Types inherited from gtsam::Factor
typedef KeyVector::iterator iterator
 Iterator over keys.
 
typedef KeyVector::const_iterator const_iterator
 Const iterator over keys.
 
- Public Types inherited from gtsam::Conditional< HybridFactor, HybridConditional >
typedef boost::iterator_range< typename FACTOR::const_iterator > Frontals
 View of the frontal keys (call frontals())
 
typedef boost::iterator_range< typename FACTOR::const_iterator > Parents
 View of the separator keys (call parents())
 

Additional Inherited Members

- Static Public Member Functions inherited from gtsam::Conditional< HybridFactor, HybridConditional >
static bool CheckInvariants (const HybridConditional &conditional, const VALUES &x)
 Check invariants of this conditional, given the values x. More...
 
- Protected Member Functions inherited from gtsam::Factor
 Factor ()
 Default constructor for I/O.
 
template<typename CONTAINER >
 Factor (const CONTAINER &keys)
 Construct factor from container of keys. More...
 
template<typename ITERATOR >
 Factor (ITERATOR first, ITERATOR last)
 Construct factor from iterator keys. More...
 
- Protected Member Functions inherited from gtsam::Conditional< HybridFactor, HybridConditional >
 Conditional ()
 Empty Constructor to make serialization possible.
 
 Conditional (size_t nrFrontals)
 Constructor.
 
- Static Protected Member Functions inherited from gtsam::Factor
template<typename CONTAINER >
static Factor FromKeys (const CONTAINER &keys)
 Construct factor from container of keys. More...
 
template<typename ITERATOR >
static Factor FromIterators (ITERATOR first, ITERATOR last)
 Construct factor from iterator keys. More...
 
- Protected Attributes inherited from gtsam::HybridConditional
boost::shared_ptr< Factorinner_
 Type-erased pointer to the inner type.
 
- Protected Attributes inherited from gtsam::HybridFactor
DiscreteKeys discreteKeys_
 
KeyVector continuousKeys_
 Record continuous keys for book-keeping.
 
- Protected Attributes inherited from gtsam::Factor
KeyVector keys_
 The keys involved in this factor.
 
- Protected Attributes inherited from gtsam::Conditional< HybridFactor, HybridConditional >
size_t nrFrontals_
 The first nrFrontal variables are frontal and the rest are parents.
 

Constructor & Destructor Documentation

◆ BayesTreeOrphanWrapper()

gtsam::BayesTreeOrphanWrapper< HybridBayesTreeClique >::BayesTreeOrphanWrapper ( const boost::shared_ptr< CliqueType > &  clique)
inline

Construct a new Bayes Tree Orphan Wrapper object.

Parameters
cliqueBayes tree clique.

Member Function Documentation

◆ print()

void gtsam::BayesTreeOrphanWrapper< HybridBayesTreeClique >::print ( const std::string &  s = "",
const KeyFormatter formatter = DefaultKeyFormatter 
) const
inlineoverridevirtual

print utility

Reimplemented from gtsam::Factor.


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