GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Public Types | Protected Attributes | List of all members
gtsam::SymbolicConditional Class Reference

#include <SymbolicConditional.h>

Inheritance diagram for gtsam::SymbolicConditional:
Inheritance graph
[legend]
Collaboration diagram for gtsam::SymbolicConditional:
Collaboration graph
[legend]

Public Types

typedef SymbolicConditional This
 
typedef SymbolicFactor BaseFactor
 Typedef to this class.
 
typedef Conditional< BaseFactor, ThisBaseConditional
 Typedef to the factor base class.
 
typedef std::shared_ptr< Thisshared_ptr
 Typedef to the conditional base class.
 
typedef BaseFactor::iterator iterator
 Boost shared_ptr to this class.
 
typedef BaseFactor::const_iterator const_iterator
 iterator to keys
 
typedef Factor Base
 
typedef SymbolicConditional ConditionalType
 
typedef std::pair< typename SymbolicFactor ::const_iterator, typename SymbolicFactor ::const_iteratorConstFactorRange
 
typedef ConstFactorRangeIterator Frontals
 
typedef ConstFactorRangeIterator Parents
 

Protected Attributes

KeyVector keys_
 The keys involved in this factor.
 
size_t nrFrontals_
 

Testable

bool equals (const This &c, double tol=1e-9) const
 

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.
 
virtual double logNormalizationConstant () const
 
double normalizationConstant () const
 

Advanced Interface

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

Standard Constructors

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

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 Constructors

const_iterator to keys

 SymbolicConditional ()
 
 SymbolicConditional (Key j)
 
 SymbolicConditional (Key j, Key parent)
 
 SymbolicConditional (Key j, Key parent1, Key parent2)
 
 SymbolicConditional (Key j, Key parent1, Key parent2, Key parent3)
 
SymbolicFactor::shared_ptr clone () const
 Copy this object as its actual derived type.
 
template<typename ITERATOR >
static SymbolicConditional FromIterators (ITERATOR firstKey, ITERATOR lastKey, size_t nrFrontals)
 
template<typename ITERATOR >
static SymbolicConditional::shared_ptr FromIteratorsShared (ITERATOR firstKey, ITERATOR lastKey, size_t nrFrontals)
 
template<class CONTAINER >
static SymbolicConditional FromKeys (const CONTAINER &keys, size_t nrFrontals)
 
template<class CONTAINER >
static SymbolicConditional::shared_ptr FromKeysShared (const CONTAINER &keys, size_t nrFrontals)
 

Testable

void print (const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
 
bool equals (const This &c, double tol=1e-9) const
 

HybridValues methods.

double logProbability (const HybridValues &x) const override
 logProbability throws exception, symbolic.
 
double evaluate (const HybridValues &x) const override
 evaluate throws exception, symbolic.
 

Testable

void printKeys (const std::string &s="SymbolicFactor", const KeyFormatter &formatter=DefaultKeyFormatter) const override
 print only keys
 

Advanced Constructors

template<typename KEYITERATOR >
static SymbolicFactor FromIterators (KEYITERATOR beginKey, KEYITERATOR endKey)
 
template<typename KEYITERATOR >
static SymbolicFactor::shared_ptr FromIteratorsShared (KEYITERATOR beginKey, KEYITERATOR endKey)
 
template<class CONTAINER >
static SymbolicFactor FromKeys (const CONTAINER &keys)
 
template<class CONTAINER >
static SymbolicFactor::shared_ptr FromKeysShared (const CONTAINER &keys)
 

Standard Interface

double error (const HybridValues &c) const override
 The error method throws an exception.
 
std::pair< std::shared_ptr< SymbolicConditional >, std::shared_ptr< SymbolicFactor > > eliminate (const Ordering &keys) const
 

Detailed Description

SymbolicConditional is a conditional with keys but no probability data, produced by symbolic elimination of SymbolicFactor.

It is also a SymbolicFactor, and thus derives from it. It derives also from Conditional<This>, which is a generic interface class for conditionals.

Member Typedef Documentation

◆ ConstFactorRange

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

◆ Frontals

typedef ConstFactorRangeIterator gtsam::Conditional< SymbolicFactor , SymbolicConditional >::Frontals
inherited

View of the frontal keys (call frontals())

◆ Parents

typedef ConstFactorRangeIterator gtsam::Conditional< SymbolicFactor , SymbolicConditional >::Parents
inherited

View of the separator keys (call parents())

Constructor & Destructor Documentation

◆ SymbolicConditional() [1/5]

gtsam::SymbolicConditional::SymbolicConditional ( )
inline

Empty Constructor to make serialization possible

◆ SymbolicConditional() [2/5]

gtsam::SymbolicConditional::SymbolicConditional ( Key  j)
inline

No parents

◆ SymbolicConditional() [3/5]

gtsam::SymbolicConditional::SymbolicConditional ( Key  j,
Key  parent 
)
inline

Single parent

◆ SymbolicConditional() [4/5]

gtsam::SymbolicConditional::SymbolicConditional ( Key  j,
Key  parent1,
Key  parent2 
)
inline

Two parents

◆ SymbolicConditional() [5/5]

gtsam::SymbolicConditional::SymbolicConditional ( Key  j,
Key  parent1,
Key  parent2,
Key  parent3 
)
inline

Three parents

Member Function Documentation

◆ 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]

SymbolicFactor ::const_iterator gtsam::Conditional< SymbolicFactor , SymbolicConditional >::beginFrontals ( ) const
inlineinherited

Iterator pointing to first frontal key.

◆ beginFrontals() [2/2]

Mutable iterator pointing to first frontal key.

◆ beginParents() [1/2]

SymbolicFactor ::const_iterator gtsam::Conditional< SymbolicFactor , SymbolicConditional >::beginParents ( ) const
inlineinherited

Iterator pointing to the first parent key.

◆ beginParents() [2/2]

Mutable iterator pointing to the first parent key.

◆ CheckInvariants()

bool gtsam::Conditional< SymbolicFactor , SymbolicConditional >::CheckInvariants ( const SymbolicConditional< SymbolicFactor, SymbolicConditional > &  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.

◆ eliminate()

std::pair<std::shared_ptr<SymbolicConditional>, std::shared_ptr<SymbolicFactor> > gtsam::SymbolicFactor::eliminate ( const Ordering keys) const
inherited

Eliminate the variables in keys, in the order specified in keys, returning a conditional and marginal.

◆ 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]

Iterator pointing past the last frontal key.

◆ endFrontals() [2/2]

Mutable iterator pointing past the last frontal key.

◆ endParents() [1/2]

Iterator pointing past the last parent key.

◆ endParents() [2/2]

Mutable iterator pointing past the last parent key.

◆ equals() [1/2]

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

Check equality

◆ equals() [2/2]

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

check equality

◆ firstFrontalKey()

Key gtsam::Conditional< SymbolicFactor , SymbolicConditional >::firstFrontalKey ( ) const
inlineinherited

Convenience function to get the first frontal key

◆ FromIterators() [1/3]

template<typename ITERATOR >
static SymbolicConditional gtsam::SymbolicConditional::FromIterators ( ITERATOR  firstKey,
ITERATOR  lastKey,
size_t  nrFrontals 
)
inlinestatic

Named constructor from an arbitrary number of keys and frontals

◆ FromIterators() [2/3]

template<typename KEYITERATOR >
static SymbolicFactor gtsam::SymbolicFactor::FromIterators ( KEYITERATOR  beginKey,
KEYITERATOR  endKey 
)
inlinestaticinherited

Constructor from a collection of keys

◆ FromIterators() [3/3]

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.

◆ FromIteratorsShared() [1/2]

template<typename ITERATOR >
static SymbolicConditional::shared_ptr gtsam::SymbolicConditional::FromIteratorsShared ( ITERATOR  firstKey,
ITERATOR  lastKey,
size_t  nrFrontals 
)
inlinestatic

Named constructor from an arbitrary number of keys and frontals

◆ FromIteratorsShared() [2/2]

template<typename KEYITERATOR >
static SymbolicFactor::shared_ptr gtsam::SymbolicFactor::FromIteratorsShared ( KEYITERATOR  beginKey,
KEYITERATOR  endKey 
)
inlinestaticinherited

Constructor from a collection of keys

◆ FromKeys() [1/2]

template<class CONTAINER >
static SymbolicConditional gtsam::SymbolicConditional::FromKeys ( const CONTAINER &  keys,
size_t  nrFrontals 
)
inlinestatic

Named constructor from an arbitrary number of keys and frontals

◆ FromKeys() [2/2]

template<class CONTAINER >
static SymbolicFactor gtsam::SymbolicFactor::FromKeys ( const CONTAINER &  keys)
inlinestaticinherited

Constructor from a collection of keys - compatible with boost assign::list_of and boost assign::cref_list_of

◆ FromKeysShared() [1/2]

template<class CONTAINER >
static SymbolicConditional::shared_ptr gtsam::SymbolicConditional::FromKeysShared ( const CONTAINER &  keys,
size_t  nrFrontals 
)
inlinestatic

Named constructor from an arbitrary number of keys and frontals

◆ FromKeysShared() [2/2]

template<class CONTAINER >
static SymbolicFactor::shared_ptr gtsam::SymbolicFactor::FromKeysShared ( const CONTAINER &  keys)
inlinestaticinherited

Constructor from a collection of keys - compatible with boost assign::list_of and boost assign::cref_list_of

◆ frontals()

Frontals gtsam::Conditional< SymbolicFactor , SymbolicConditional >::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::Conditional< SymbolicFactor , SymbolicConditional >::logNormalizationConstant ( ) const
virtualinherited

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

◆ normalizationConstant()

double gtsam::Conditional< SymbolicFactor , SymbolicConditional >::normalizationConstant ( ) const
inherited

Non-virtual, exponentiate logNormalizationConstant.

◆ nrFrontals() [1/2]

size_t gtsam::Conditional< SymbolicFactor , SymbolicConditional >::nrFrontals ( ) const
inlineinherited

return the number of frontals

◆ nrFrontals() [2/2]

size_t& gtsam::Conditional< SymbolicFactor , SymbolicConditional >::nrFrontals ( )
inlineinherited

Mutable version of nrFrontals

◆ nrParents()

size_t gtsam::Conditional< SymbolicFactor , SymbolicConditional >::nrParents ( ) const
inlineinherited

return the number of parents

◆ parents()

Parents gtsam::Conditional< SymbolicFactor , SymbolicConditional >::parents ( ) const
inlineinherited

return a view of the parent keys

◆ print()

void gtsam::SymbolicConditional::print ( const std::string &  str = "",
const KeyFormatter keyFormatter = DefaultKeyFormatter 
) const
overridevirtual

Print with optional formatter

Reimplemented from gtsam::Factor.

◆ 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< SymbolicFactor , SymbolicConditional >::nrFrontals_
protectedinherited

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


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