#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 | negLogConstant () const |
All conditional types need to implement this as the negative log of the normalization constant to make it such that error>=0. More... | |
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_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) |
Definition at line 63 of file Conditional.h.
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 77 of file Conditional.h.
typedef ConstFactorRangeIterator gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::Frontals |
View of the frontal keys (call frontals())
Definition at line 96 of file Conditional.h.
typedef ConstFactorRangeIterator gtsam::Conditional< FACTOR, DERIVEDCONDITIONAL >::Parents |
View of the separator keys (call parents())
Definition at line 99 of file Conditional.h.
|
private |
Typedef to this class.
Definition at line 71 of file Conditional.h.
|
inlineprotected |
Empty Constructor to make serialization possible
Definition at line 106 of file Conditional.h.
|
inlineprotected |
Constructor
Definition at line 109 of file Conditional.h.
|
inlinevirtual |
Definition at line 128 of file Conditional.h.
|
inlineprivate |
Definition at line 231 of file Conditional.h.
|
inlineprivate |
Definition at line 234 of file Conditional.h.
|
inline |
Mutable iterator pointing to first frontal key.
Definition at line 195 of file Conditional.h.
|
inline |
Iterator pointing to first frontal key.
Definition at line 180 of file Conditional.h.
|
inline |
Mutable iterator pointing to the first parent key.
Definition at line 201 of file Conditional.h.
|
inline |
Iterator pointing to the first parent key.
Definition at line 186 of file Conditional.h.
|
static |
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. |
Definition at line 69 of file Conditional-inst.h.
|
inline |
Mutable iterator pointing past the last frontal key.
Definition at line 198 of file Conditional.h.
|
inline |
Iterator pointing past the last frontal key.
Definition at line 183 of file Conditional.h.
|
inline |
Mutable iterator pointing past the last parent key.
Definition at line 204 of file Conditional.h.
|
inline |
Iterator pointing past the last parent key.
Definition at line 189 of file Conditional.h.
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.
|
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::SymbolicConditional, gtsam::HybridGaussianConditional, and gtsam::HybridConditional.
Definition at line 55 of file Conditional-inst.h.
|
inline |
Convenience function to get the first frontal key
Definition at line 137 of file Conditional.h.
|
inline |
return a view of the frontal keys
Definition at line 145 of file Conditional.h.
|
virtual |
All conditional types need to implement a logProbability
function, for which exp(logProbability(x)) = evaluate(x).
Reimplemented in gtsam::GaussianConditional, gtsam::DiscreteConditional, gtsam::SymbolicConditional, gtsam::HybridGaussianConditional, and gtsam::HybridConditional.
Definition at line 48 of file Conditional-inst.h.
|
virtual |
All conditional types need to implement this as the negative log of the normalization constant to make it such that error>=0.
Definition at line 62 of file Conditional-inst.h.
|
inline |
Mutable version of nrFrontals
Definition at line 192 of file Conditional.h.
|
inline |
return the number of frontals
Definition at line 131 of file Conditional.h.
|
inline |
return the number of parents
Definition at line 134 of file Conditional.h.
|
inline |
Evaluate probability density, sugar.
Definition at line 163 of file Conditional.h.
|
inline |
return a view of the parent keys
Definition at line 148 of file Conditional.h.
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.
|
protected |
The first nrFrontal variables are frontal and the rest are parents.
Definition at line 67 of file Conditional.h.