GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Classes | Public Types | Protected Attributes | List of all members
gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL > Class Template Reference

Classes

struct  ConstFactorRangeIterator
 

Public Types

typedef std::pair< typename FACTOR::const_iterator, typename FACTOR::const_iterator > ConstFactorRange
 
typedef ConstFactorRangeIterator Frontals
 
typedef ConstFactorRangeIterator Parents
 

Public Member Functions

Testable
void print (const std::string &s="Conditional", const KeyFormatter &formatter=DefaultKeyFormatter) const
 
bool equals (const This &c, double tol=1e-9) const
 
Standard Interface
virtual ~Conditional ()
 
size_t nrFrontals () const
 
size_t nrParents () const
 
Key firstFrontalKey () const
 
Frontals frontals () const
 
Parents parents () const
 
virtual double logProbability (const HybridValues &c) const
 
virtual double evaluate (const HybridValues &c) const
 
double operator() (const HybridValues &x) const
 Evaluate probability density, sugar.
 
virtual double logNormalizationConstant () const
 
double normalizationConstant () const
 

Protected Member Functions

Standard Constructors
 Conditional ()
 
 Conditional (size_t nrFrontals)
 

Protected Attributes

size_t nrFrontals_
 

Advanced Interface

FACTOR::const_iterator beginFrontals () const
 
FACTOR::const_iterator endFrontals () const
 
FACTOR::const_iterator beginParents () const
 
FACTOR::const_iterator endParents () const
 
size_t & nrFrontals ()
 
FACTOR::iterator beginFrontals ()
 
FACTOR::iterator endFrontals ()
 
FACTOR::iterator beginParents ()
 
FACTOR::iterator endParents ()
 
template<class VALUES >
static bool CheckInvariants (const DERIVEDCONDITIONAL &conditional, const VALUES &x)
 

Member Typedef Documentation

◆ ConstFactorRange

template<class FACTOR, class DERIVEDCONDITIONAL>
typedef std::pair<typename FACTOR::const_iterator, typename FACTOR::const_iterator> gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::ConstFactorRange

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

◆ Frontals

template<class FACTOR, class DERIVEDCONDITIONAL>
typedef ConstFactorRangeIterator gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::Frontals

View of the frontal keys (call frontals())

◆ Parents

template<class FACTOR, class DERIVEDCONDITIONAL>
typedef ConstFactorRangeIterator gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::Parents

View of the separator keys (call parents())

Constructor & Destructor Documentation

◆ Conditional() [1/2]

template<class FACTOR, class DERIVEDCONDITIONAL>
gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::Conditional ( )
inlineprotected

Empty Constructor to make serialization possible

◆ Conditional() [2/2]

template<class FACTOR, class DERIVEDCONDITIONAL>
gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::Conditional ( size_t  nrFrontals)
inlineprotected

Constructor

Member Function Documentation

◆ beginFrontals() [1/2]

template<class FACTOR, class DERIVEDCONDITIONAL>
FACTOR::const_iterator gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::beginFrontals ( ) const
inline

Iterator pointing to first frontal key.

◆ beginFrontals() [2/2]

template<class FACTOR, class DERIVEDCONDITIONAL>
FACTOR::iterator gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::beginFrontals ( )
inline

Mutable iterator pointing to first frontal key.

◆ beginParents() [1/2]

template<class FACTOR, class DERIVEDCONDITIONAL>
FACTOR::const_iterator gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::beginParents ( ) const
inline

Iterator pointing to the first parent key.

◆ beginParents() [2/2]

template<class FACTOR, class DERIVEDCONDITIONAL>
FACTOR::iterator gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::beginParents ( )
inline

Mutable iterator pointing to the first parent key.

◆ CheckInvariants()

template<class FACTOR , class DERIVEDCONDITIONAL>
template<class VALUES >
bool gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::CheckInvariants ( const DERIVEDCONDITIONAL &  conditional,
const VALUES &  x 
)
static

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.

◆ endFrontals() [1/2]

template<class FACTOR, class DERIVEDCONDITIONAL>
FACTOR::const_iterator gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::endFrontals ( ) const
inline

Iterator pointing past the last frontal key.

◆ endFrontals() [2/2]

template<class FACTOR, class DERIVEDCONDITIONAL>
FACTOR::iterator gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::endFrontals ( )
inline

Mutable iterator pointing past the last frontal key.

◆ endParents() [1/2]

template<class FACTOR, class DERIVEDCONDITIONAL>
FACTOR::const_iterator gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::endParents ( ) const
inline

Iterator pointing past the last parent key.

◆ endParents() [2/2]

template<class FACTOR, class DERIVEDCONDITIONAL>
FACTOR::iterator gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::endParents ( )
inline

Mutable iterator pointing past the last parent key.

◆ equals()

template<class FACTOR , class DERIVEDCONDITIONAL >
bool gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::equals ( const This c,
double  tol = 1e-9 
) const

check equality

◆ evaluate()

template<class FACTOR , class DERIVEDCONDITIONAL >
double gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::evaluate ( const HybridValues c) const
virtual

All conditional types need to implement an evaluate function, that yields a true probability. The default implementation just exponentiates logProbability.

Reimplemented in gtsam::GaussianConditional, gtsam::DiscreteConditional, gtsam::GaussianMixture, gtsam::HybridConditional, and gtsam::SymbolicConditional.

◆ firstFrontalKey()

template<class FACTOR, class DERIVEDCONDITIONAL>
Key gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::firstFrontalKey ( ) const
inline

Convenience function to get the first frontal key

◆ frontals()

template<class FACTOR, class DERIVEDCONDITIONAL>
Frontals gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::frontals ( ) const
inline

return a view of the frontal keys

◆ logNormalizationConstant()

template<class FACTOR , class DERIVEDCONDITIONAL >
double gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::logNormalizationConstant ( ) const
virtual

All conditional types need to implement a log normalization constant to make it such that error>=0.

Reimplemented in gtsam::DiscreteConditional, gtsam::HybridConditional, gtsam::GaussianMixture, and gtsam::GaussianConditional.

◆ logProbability()

template<class FACTOR , class DERIVEDCONDITIONAL >
double gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::logProbability ( const HybridValues c) const
virtual

All conditional types need to implement a logProbability function, for which exp(logProbability(x)) = evaluate(x).

Reimplemented in gtsam::GaussianConditional, gtsam::DiscreteConditional, gtsam::GaussianMixture, gtsam::HybridConditional, and gtsam::SymbolicConditional.

◆ normalizationConstant()

template<class FACTOR , class DERIVEDCONDITIONAL >
double gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::normalizationConstant ( ) const

Non-virtual, exponentiate logNormalizationConstant.

◆ nrFrontals() [1/2]

template<class FACTOR, class DERIVEDCONDITIONAL>
size_t gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::nrFrontals ( ) const
inline

return the number of frontals

◆ nrFrontals() [2/2]

template<class FACTOR, class DERIVEDCONDITIONAL>
size_t& gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::nrFrontals ( )
inline

Mutable version of nrFrontals

◆ nrParents()

template<class FACTOR, class DERIVEDCONDITIONAL>
size_t gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::nrParents ( ) const
inline

return the number of parents

◆ parents()

template<class FACTOR, class DERIVEDCONDITIONAL>
Parents gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::parents ( ) const
inline

return a view of the parent keys

◆ print()

template<class FACTOR , class DERIVEDCONDITIONAL >
void gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::print ( const std::string &  s = "Conditional< FACTOR, DERIVEDCONDITIONAL >",
const KeyFormatter formatter = DefaultKeyFormatter 
) const

print with optional formatter

Member Data Documentation

◆ nrFrontals_

template<class FACTOR, class DERIVEDCONDITIONAL>
size_t gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::nrFrontals_
protected

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


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