Classes | Public Types | Protected Attributes | Private Types | List of all members
gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL > Class Template Reference

#include <Conditional.h>

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

Protected Member Functions

Standard Constructors
 Conditional ()
 
 Conditional (size_t nrFrontals)
 

Protected Attributes

size_t nrFrontals_
 

Private Types

typedef Conditional< FACTOR, DERIVEDCONDITIONAL > This
 Typedef to this class. More...
 

Private Member Functions

Serialization
FACTOR & asFactor ()
 
const FACTOR & asFactor () const
 

Advanced Interface

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

Detailed Description

template<class FACTOR, class DERIVEDCONDITIONAL>
class gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >

Definition at line 61 of file Conditional.h.

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.

Definition at line 75 of file Conditional.h.

◆ Frontals

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

View of the frontal keys (call frontals())

Definition at line 94 of file Conditional.h.

◆ Parents

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

View of the separator keys (call parents())

Definition at line 97 of file Conditional.h.

◆ This

template<class FACTOR, class DERIVEDCONDITIONAL>
typedef Conditional<FACTOR,DERIVEDCONDITIONAL> gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::This
private

Typedef to this class.

Definition at line 69 of file Conditional.h.

Constructor & Destructor Documentation

◆ Conditional() [1/2]

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

Empty Constructor to make serialization possible

Definition at line 104 of file Conditional.h.

◆ Conditional() [2/2]

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

Constructor

Definition at line 107 of file Conditional.h.

◆ ~Conditional()

template<class FACTOR, class DERIVEDCONDITIONAL>
virtual gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::~Conditional ( )
inlinevirtual

Definition at line 126 of file Conditional.h.

Member Function Documentation

◆ asFactor() [1/2]

template<class FACTOR, class DERIVEDCONDITIONAL>
FACTOR& gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::asFactor ( )
inlineprivate

Definition at line 230 of file Conditional.h.

◆ asFactor() [2/2]

template<class FACTOR, class DERIVEDCONDITIONAL>
const FACTOR& gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::asFactor ( ) const
inlineprivate

Definition at line 233 of file Conditional.h.

◆ beginFrontals() [1/2]

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

Iterator pointing to first frontal key.

Definition at line 179 of file Conditional.h.

◆ beginFrontals() [2/2]

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

Mutable iterator pointing to first frontal key.

Definition at line 194 of file Conditional.h.

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

Definition at line 185 of file Conditional.h.

◆ beginParents() [2/2]

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

Mutable iterator pointing to the first parent key.

Definition at line 200 of file Conditional.h.

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

Definition at line 77 of file Conditional-inst.h.

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

Definition at line 182 of file Conditional.h.

◆ endFrontals() [2/2]

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

Mutable iterator pointing past the last frontal key.

Definition at line 197 of file Conditional.h.

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

Definition at line 188 of file Conditional.h.

◆ endParents() [2/2]

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

Mutable iterator pointing past the last parent key.

Definition at line 203 of file Conditional.h.

◆ equals()

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

check equality

Definition at line 41 of file Conditional-inst.h.

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

Definition at line 55 of file Conditional-inst.h.

◆ firstFrontalKey()

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

Convenience function to get the first frontal key

Definition at line 135 of file Conditional.h.

◆ frontals()

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

return a view of the frontal keys

Definition at line 143 of file Conditional.h.

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

Definition at line 62 of file Conditional-inst.h.

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

Definition at line 48 of file Conditional-inst.h.

◆ normalizationConstant()

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

Non-virtual, exponentiate logNormalizationConstant.

Definition at line 70 of file Conditional-inst.h.

◆ nrFrontals() [1/2]

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

return the number of frontals

Definition at line 129 of file Conditional.h.

◆ nrFrontals() [2/2]

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

Mutable version of nrFrontals

Definition at line 191 of file Conditional.h.

◆ nrParents()

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

return the number of parents

Definition at line 132 of file Conditional.h.

◆ operator()()

template<class FACTOR, class DERIVEDCONDITIONAL>
double gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::operator() ( const HybridValues x) const
inline

Evaluate probability density, sugar.

Definition at line 161 of file Conditional.h.

◆ parents()

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

return a view of the parent keys

Definition at line 146 of file Conditional.h.

◆ 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

Definition at line 30 of file Conditional-inst.h.

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.

Definition at line 65 of file Conditional.h.


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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:46:16