GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
gtsam::BayesTreeOrphanWrapper< HybridBayesTreeClique > Class Template Reference

Class for Hybrid Bayes tree orphan subtrees. More...

#include <HybridBayesTree.h>

Inheritance diagram for gtsam::BayesTreeOrphanWrapper< HybridBayesTreeClique >:
Inheritance graph
[legend]
Collaboration diagram for gtsam::BayesTreeOrphanWrapper< HybridBayesTreeClique >:
Collaboration graph
[legend]

Public Types

typedef HybridBayesTreeClique CliqueType
 
typedef HybridConditional Base
 
typedef HybridConditional This
 Typedef to this class.
 
typedef std::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.
 
typedef KeyVector::iterator iterator
 Iterator over keys.
 
typedef KeyVector::const_iterator const_iterator
 Const iterator over keys.
 
typedef std::pair< typename HybridFactor ::const_iterator, typename HybridFactor ::const_iteratorConstFactorRange
 
typedef ConstFactorRangeIterator Frontals
 
typedef ConstFactorRangeIterator Parents
 

Public Member Functions

 BayesTreeOrphanWrapper (const std::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
 
Testable
bool equals (const HybridFactor &other, double tol=1e-9) const override
 GTSAM-style equals.
 
Testable
bool equals (const This &other, double tol=1e-9) const
 check equality
 
virtual void printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
 print only keys
 
Testable
bool equals (const This &c, double tol=1e-9) const
 
Standard Interface
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...
 
std::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.
 
double logProbability (const HybridValues &values) const override
 Return the log-probability (or density) of the underlying conditional.
 
double logNormalizationConstant () const override
 
double evaluate (const HybridValues &values) const override
 Return the probability (or density) of the underlying conditional.
 
bool frontalsIn (const VectorValues &measurements) const
 Check if VectorValues measurements contains all frontal keys.
 
Standard Interface
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.
 
Standard Interface
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
 
const_iterator end () const
 
size_t size () const
 
Advanced Interface
KeyVectorkeys ()
 
iterator begin ()
 
iterator end ()
 
Standard Interface
size_t nrFrontals () const
 
size_t nrParents () const
 
Key firstFrontalKey () const
 
Frontals frontals () const
 
Parents parents () const
 
double operator() (const HybridValues &x) const
 Evaluate probability density, sugar.
 
double normalizationConstant () const
 

Public Attributes

std::shared_ptr< CliqueTypeclique
 

Static Protected Member Functions

Standard Constructors
template<typename CONTAINER >
static Factor FromKeys (const CONTAINER &keys)
 
template<typename ITERATOR >
static Factor FromIterators (ITERATOR first, ITERATOR last)
 

Protected Attributes

std::shared_ptr< Factorinner_
 Type-erased pointer to the inner type.
 
DiscreteKeys discreteKeys_
 
KeyVector continuousKeys_
 Record continuous keys for book-keeping.
 
KeyVector keys_
 The keys involved in this factor.
 
size_t nrFrontals_
 

Advanced Interface

size_t & nrFrontals ()
 
HybridFactor ::const_iterator beginFrontals () const
 
HybridFactor ::iterator beginFrontals ()
 
HybridFactor ::const_iterator endFrontals () const
 
HybridFactor ::iterator endFrontals ()
 
HybridFactor ::const_iterator beginParents () const
 
HybridFactor ::iterator beginParents ()
 
HybridFactor ::const_iterator endParents () const
 
HybridFactor ::iterator endParents ()
 
static bool CheckInvariants (const HybridConditional &conditional, const VALUES &x)
 

Detailed Description

template<>
class gtsam::BayesTreeOrphanWrapper< HybridBayesTreeClique >

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.

Member Typedef Documentation

◆ ConstFactorRange

A mini implementation of an iterator range, to share const views of frontals and parents.

◆ Frontals

typedef ConstFactorRangeIterator gtsam::Conditional< HybridFactor , HybridConditional >::Frontals
inherited

View of the frontal keys (call frontals())

◆ Parents

typedef ConstFactorRangeIterator gtsam::Conditional< HybridFactor , HybridConditional >::Parents
inherited

View of the separator keys (call parents())

Constructor & Destructor Documentation

◆ BayesTreeOrphanWrapper()

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

Construct a new Bayes Tree Orphan Wrapper object.

Parameters
cliqueBayes tree clique.

Member Function Documentation

◆ asDiscrete()

DiscreteConditional::shared_ptr gtsam::HybridConditional::asDiscrete ( ) const
inlineinherited

Return conditional as a DiscreteConditional.

Returns
nullptr if not a DiscreteConditional
DiscreteConditional::shared_ptr

◆ asGaussian()

GaussianConditional::shared_ptr gtsam::HybridConditional::asGaussian ( ) const
inlineinherited

◆ asMixture()

GaussianMixture::shared_ptr gtsam::HybridConditional::asMixture ( ) const
inlineinherited

Return HybridConditional as a GaussianMixture.

Returns
nullptr if not a mixture
GaussianMixture::shared_ptr otherwise

◆ begin() [1/2]

const_iterator gtsam::Factor::begin ( ) const
inlineinherited

Iterator at beginning of involved variable keys

◆ begin() [2/2]

iterator gtsam::Factor::begin ( )
inlineinherited

Iterator at beginning of involved variable keys

◆ beginFrontals() [1/2]

HybridFactor ::const_iterator gtsam::Conditional< HybridFactor , HybridConditional >::beginFrontals ( ) const
inlineinherited

Iterator pointing to first frontal key.

◆ beginFrontals() [2/2]

HybridFactor ::iterator gtsam::Conditional< HybridFactor , HybridConditional >::beginFrontals ( )
inlineinherited

Mutable iterator pointing to first frontal key.

◆ beginParents() [1/2]

HybridFactor ::const_iterator gtsam::Conditional< HybridFactor , HybridConditional >::beginParents ( ) const
inlineinherited

Iterator pointing to the first parent key.

◆ beginParents() [2/2]

HybridFactor ::iterator gtsam::Conditional< HybridFactor , HybridConditional >::beginParents ( )
inlineinherited

Mutable iterator pointing to the first parent key.

◆ CheckInvariants()

bool gtsam::Conditional< HybridFactor , HybridConditional >::CheckInvariants ( const HybridConditional< HybridFactor, HybridConditional > &  conditional,
const VALUES &  x 
)
staticinherited

Check invariants of this conditional, given the values x. It tests:

Parameters
conditionalThe conditional to test, as a reference to the derived type.
Template Parameters
VALUESHybridValues, or a more narrow type like DiscreteValues.

◆ end() [1/2]

const_iterator gtsam::Factor::end ( ) const
inlineinherited

Iterator at end of involved variable keys

◆ end() [2/2]

iterator gtsam::Factor::end ( )
inlineinherited

Iterator at end of involved variable keys

◆ endFrontals() [1/2]

HybridFactor ::const_iterator gtsam::Conditional< HybridFactor , HybridConditional >::endFrontals ( ) const
inlineinherited

Iterator pointing past the last frontal key.

◆ endFrontals() [2/2]

HybridFactor ::iterator gtsam::Conditional< HybridFactor , HybridConditional >::endFrontals ( )
inlineinherited

Mutable iterator pointing past the last frontal key.

◆ endParents() [1/2]

HybridFactor ::const_iterator gtsam::Conditional< HybridFactor , HybridConditional >::endParents ( ) const
inlineinherited

Iterator pointing past the last parent key.

◆ endParents() [2/2]

HybridFactor ::iterator gtsam::Conditional< HybridFactor , HybridConditional >::endParents ( )
inlineinherited

Mutable iterator pointing past the last parent key.

◆ equals()

bool gtsam::Conditional< HybridFactor , HybridConditional >::equals ( const This c,
double  tol = 1e-9 
) const
inherited

check equality

◆ firstFrontalKey()

Key gtsam::Conditional< HybridFactor , HybridConditional >::firstFrontalKey ( ) const
inlineinherited

Convenience function to get the first frontal key

◆ FromIterators()

template<typename ITERATOR >
static Factor gtsam::Factor::FromIterators ( ITERATOR  first,
ITERATOR  last 
)
inlinestaticprotectedinherited

Construct factor from iterator keys. This is called internally from derived factor static factor methods, as a workaround for not being able to call the protected constructors above.

◆ FromKeys()

template<typename CONTAINER >
static Factor gtsam::Factor::FromKeys ( const CONTAINER &  keys)
inlinestaticprotectedinherited

Construct factor from container of keys. This is called internally from derived factor static factor methods, as a workaround for not being able to call the protected constructors above.

◆ frontals()

Frontals gtsam::Conditional< HybridFactor , HybridConditional >::frontals ( ) const
inlineinherited

return a view of the frontal keys

◆ keys()

KeyVector& gtsam::Factor::keys ( )
inlineinherited
Returns
keys involved in this factor

◆ logNormalizationConstant()

double gtsam::HybridConditional::logNormalizationConstant ( ) const
overridevirtualinherited

Return the log normalization constant. Note this is 0.0 for discrete and hybrid conditionals, but depends on the continuous parameters for Gaussian conditionals.

Reimplemented from gtsam::Conditional< HybridFactor, HybridConditional >.

◆ normalizationConstant()

double gtsam::Conditional< HybridFactor , HybridConditional >::normalizationConstant ( ) const
inherited

Non-virtual, exponentiate logNormalizationConstant.

◆ nrFrontals() [1/2]

size_t gtsam::Conditional< HybridFactor , HybridConditional >::nrFrontals ( ) const
inlineinherited

return the number of frontals

◆ nrFrontals() [2/2]

size_t& gtsam::Conditional< HybridFactor , HybridConditional >::nrFrontals ( )
inlineinherited

Mutable version of nrFrontals

◆ nrParents()

size_t gtsam::Conditional< HybridFactor , HybridConditional >::nrParents ( ) const
inlineinherited

return the number of parents

◆ parents()

Parents gtsam::Conditional< HybridFactor , HybridConditional >::parents ( ) const
inlineinherited

return a view of the parent keys

◆ size()

size_t gtsam::Factor::size ( ) const
inlineinherited
Returns
the number of variables involved in this factor

Member Data Documentation

◆ nrFrontals_

size_t gtsam::Conditional< HybridFactor , HybridConditional >::nrFrontals_
protectedinherited

The first nrFrontal variables are frontal and the rest are parents.


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