Loading...
Searching...
No Matches
gtsam::SymbolicConditional Class Reference

## 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.

Inheritance diagram for gtsam::SymbolicConditional:

## Standard Constructors

const_iterator to keys
| SymbolicConditional ()
| Empty Constructor to make serialization possible.
| SymbolicConditional (Key j)
| No parents.
| SymbolicConditional (Key j, Key parent)
| Single parent.
| SymbolicConditional (Key j, Key parent1, Key parent2)
| Two parents.
| SymbolicConditional (Key j, Key parent1, Key parent2, Key parent3)
| Three parents.
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)
| Named constructor from an arbitrary number of keys and frontals.
template<typename ITERATOR>
static SymbolicConditional::shared_ptr | FromIteratorsShared (ITERATOR firstKey, ITERATOR lastKey, size_t nrFrontals)
| Named constructor from an arbitrary number of keys and frontals.
template<class CONTAINER>
static SymbolicConditional | FromKeys (const CONTAINER &keys, size_t nrFrontals)
| Named constructor from an arbitrary number of keys and frontals.
template<class CONTAINER>
static SymbolicConditional::shared_ptr | FromKeysShared (const CONTAINER &keys, size_t nrFrontals)
| Named constructor from an arbitrary number of keys and frontals.

## Testable

void | print (const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
| Print with optional formatter.
bool | equals (const This &c, double tol=1e-9) const
| Check equality.

## HybridValues methods.

double | logProbability (const HybridValues &x) const override
| logProbability throws exception, symbolic.
double | evaluate (const HybridValues &x) const override
| evaluate throws exception, symbolic.
double | operator() (const HybridValues &x) const
| Evaluate probability density, sugar.
double | error (const HybridValues &c) const override
| The error method throws an exception.

## Public Types

typedef SymbolicConditional | This
typedef SymbolicFactor | BaseFactor
| Typedef to this class.
typedef Conditional< BaseFactor, This > | BaseConditional
| Typedef to the factor base class.
typedef boost::shared_ptr< This > | shared_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
Public Types inherited from gtsam::SymbolicFactor
typedef SymbolicFactor | This
typedef Factor | Base
typedef SymbolicConditional | ConditionalType
typedef boost::shared_ptr< This > | shared_ptr
| Overriding the shared_ptr typedef.
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< SymbolicFactor, SymbolicConditional >
typedef boost::iterator_range< typename SymbolicFactor::const_iterator > | Frontals
| View of the frontal keys (call frontals()).
typedef boost::iterator_range< typename SymbolicFactor::const_iterator > | Parents
| View of the separator keys (call parents()).

## Friends

class | boost::serialization::access
| Serialization function.

## Additional Inherited Members

| SymbolicFactor ()
| Default constructor for I/O.
| SymbolicFactor (Key j)
| Construct unary factor.
| SymbolicFactor (Key j1, Key j2)
| Construct binary factor.
| SymbolicFactor (Key j1, Key j2, Key j3)
| Construct ternary factor.
| SymbolicFactor (Key j1, Key j2, Key j3, Key j4)
| Construct 4-way factor.
| SymbolicFactor (Key j1, Key j2, Key j3, Key j4, Key j5)
| Construct 5-way factor.
| SymbolicFactor (Key j1, Key j2, Key j3, Key j4, Key j5, Key j6)
| Construct 6-way factor.
| SymbolicFactor (const Factor &factor)
| Create symbolic version of any factor.
SymbolicFactor::shared_ptr | clone () const
| Copy this object as its actual derived type.
bool | equals (const This &other, double tol=1e-9) const
void | print (const std::string &s="SymbolicFactor", const KeyFormatter &formatter=DefaultKeyFormatter) const override
| print
void | printKeys (const std::string &s="SymbolicFactor", const KeyFormatter &formatter=DefaultKeyFormatter) const override
| print only keys
double | error (const HybridValues &c) const override
| The error method throws an exception.
std::pair< boost::shared_ptr< SymbolicConditional >, boost::shared_ptr< SymbolicFactor > > | eliminate (const Ordering &keys) const
| Eliminate the variables in `keys`, in the order specified in `keys`, returning a conditional and marginal.
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 KeyVector & | keys () 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
bool | equals (const This &other, double tol=1e-9) const
| check equality
KeyVector & | keys ()
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< SymbolicFactor, SymbolicConditional >
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
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.
virtual double | logNormalizationConstant () const
| All conditional types need to implement a log normalization constant to make it such that error>=0.
double | normalizationConstant () const
| Non-virtual, exponentiate logNormalizationConstant.
SymbolicFactor::const_iterator | beginFrontals () const
| Iterator pointing to first frontal key.
SymbolicFactor::const_iterator | endFrontals () const
| Iterator pointing past the last frontal key.
SymbolicFactor::const_iterator | beginParents () const
| Iterator pointing to the first parent key.
SymbolicFactor::const_iterator | endParents () const
| Iterator pointing past the last parent key.
template<typename KEYITERATOR>
static SymbolicFactor | FromIterators (KEYITERATOR beginKey, KEYITERATOR endKey)
| Constructor from a collection of keys.
template<typename KEYITERATOR>
static SymbolicFactor::shared_ptr | FromIteratorsShared (KEYITERATOR beginKey, KEYITERATOR endKey)
| Constructor from a collection of keys.
template<class CONTAINER>
static SymbolicFactor | FromKeys (const CONTAINER &keys)
| Constructor from a collection of keys - compatible with boost assign::list_of and boost assign::cref_list_of.
template<class CONTAINER>
static SymbolicFactor::shared_ptr | FromKeysShared (const CONTAINER &keys)
| Constructor from a collection of keys - compatible with boost assign::list_of and boost assign::cref_list_of.
static bool | CheckInvariants (const SymbolicConditional &conditional, const VALUES &x)
| Check invariants of this conditional, given the values x.
| Factor ()
| Default constructor for I/O.
template<typename CONTAINER>
| Factor (const CONTAINER &keys)
| Construct factor from container of keys.
template<typename ITERATOR>
| Factor (ITERATOR first, ITERATOR last)
| Construct factor from iterator keys.
Protected Member Functions inherited from gtsam::Conditional< SymbolicFactor, SymbolicConditional >
| Conditional ()
| Empty Constructor to make serialization possible.
template<typename CONTAINER>
static Factor | FromKeys (const CONTAINER &keys)
| Construct factor from container of keys.
template<typename ITERATOR>
static Factor | FromIterators (ITERATOR first, ITERATOR last)
| Construct factor from iterator keys.
Protected Attributes inherited from gtsam::Factor
KeyVector | keys_
| The keys involved in this factor.
Protected Attributes inherited from gtsam::Conditional< SymbolicFactor, SymbolicConditional >
size_t | nrFrontals_
| The first nrFrontal variables are frontal and the rest are parents.

## Member Function Documentation

## error()

double gtsam::SymbolicFactor::error | ( | const HybridValues & | c | ) | const

override virtual

The error method throws an exception.

Reimplemented from gtsam::Factor.

## evaluate()

double gtsam::SymbolicConditional::evaluate | ( | const HybridValues & | x | ) | const

override virtual

evaluate throws exception, symbolic.

Reimplemented from gtsam::Conditional< SymbolicFactor, SymbolicConditional >.

## logProbability()

double gtsam::SymbolicConditional::logProbability | ( | const HybridValues & | x | ) | const

override virtual

logProbability throws exception, symbolic.

Reimplemented from gtsam::Conditional< SymbolicFactor, SymbolicConditional >.

## print()

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

override virtual

Print with optional formatter.

Reimplemented from gtsam::Factor.

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

- /build/gtsam-gchP9J/gtsam-4.2.2+dfsg/gtsam/symbolic/SymbolicConditional.h
- /build/gtsam-gchP9J/gtsam-4.2.2+dfsg/gtsam/symbolic/SymbolicConditional.cpp