GTSAM
4.0.2
C++ library for smoothing and mapping (SAM)
|
Class for Hybrid Bayes tree orphan subtrees. More...
#include <HybridBayesTree.h>
Public Types | |
typedef HybridBayesTreeClique | CliqueType |
typedef HybridConditional | Base |
typedef HybridConditional | This |
Typedef to this class. | |
typedef std::shared_ptr< This > | shared_ptr |
shared_ptr to this class | |
typedef HybridFactor | BaseFactor |
Typedef to our factor base class. | |
typedef Conditional< BaseFactor, This > | BaseConditional |
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_iterator > | ConstFactorRange |
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< Factor > | inner () 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 DiscreteKeys & | discreteKeys () const |
Return the discrete keys for this factor. | |
const KeyVector & | continuousKeys () 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 KeyVector & | keys () const |
Access the factor's involved variable keys. | |
const_iterator | begin () const |
const_iterator | end () const |
size_t | size () const |
Advanced Interface | |
KeyVector & | keys () |
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< CliqueType > | clique |
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< Factor > | inner_ |
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) |
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.
|
inherited |
A mini implementation of an iterator range, to share const views of frontals and parents.
|
inherited |
View of the frontal keys (call frontals())
|
inherited |
View of the separator keys (call parents())
|
inline |
Construct a new Bayes Tree Orphan Wrapper object.
clique | Bayes tree clique. |
|
inlineinherited |
Return conditional as a DiscreteConditional.
|
inlineinherited |
Return HybridConditional as a GaussianConditional.
|
inlineinherited |
Return HybridConditional as a GaussianMixture.
|
inlineinherited |
Iterator at beginning of involved variable keys
|
inlineinherited |
Iterator at beginning of involved variable keys
|
inlineinherited |
Iterator pointing to first frontal key.
|
inlineinherited |
Mutable iterator pointing to first frontal key.
|
inlineinherited |
Iterator pointing to the first parent key.
|
inlineinherited |
Mutable iterator pointing to the first parent key.
|
staticinherited |
Check invariants of this conditional, given the values x
. It tests:
conditional | The conditional to test, as a reference to the derived type. |
VALUES | HybridValues, or a more narrow type like DiscreteValues. |
|
inlineinherited |
Iterator at end of involved variable keys
|
inlineinherited |
Iterator at end of involved variable keys
|
inlineinherited |
Iterator pointing past the last frontal key.
|
inlineinherited |
Mutable iterator pointing past the last frontal key.
|
inlineinherited |
Iterator pointing past the last parent key.
|
inlineinherited |
Mutable iterator pointing past the last parent key.
|
inherited |
check equality
|
inlineinherited |
Convenience function to get the first frontal key
|
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.
|
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.
|
inlineinherited |
return a view of the frontal keys
|
inlineinherited |
|
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 >.
|
inherited |
Non-virtual, exponentiate logNormalizationConstant.
|
inlineinherited |
return the number of frontals
|
inlineinherited |
Mutable version of nrFrontals
|
inlineinherited |
return the number of parents
|
inlineinherited |
return a view of the parent keys
|
inlineinherited |
|
protectedinherited |
The first nrFrontal variables are frontal and the rest are parents.