Implementation of a discrete conditional mixture factor.
Implements a joint discrete-continuous factor where the discrete variable serves to "select" a mixture component corresponding to a NonlinearFactor type of measurement.
This class stores all factors as HybridFactors which can then be typecast to one of (NonlinearFactor, GaussianFactor) which can then be checked to perform the correct operation.
|
| MixtureFactor (const KeyVector &keys, const DiscreteKeys &discreteKeys, const Factors &factors, bool normalized=false) |
| Construct from Decision tree.
|
|
template<typename FACTOR > |
| MixtureFactor (const KeyVector &keys, const DiscreteKeys &discreteKeys, const std::vector< boost::shared_ptr< FACTOR > > &factors, bool normalized=false) |
| Convenience constructor that generates the underlying factor decision tree for us.
|
|
AlgebraicDecisionTree< Key > | error (const Values &continuousValues) const |
| Compute error of the MixtureFactor as a tree.
|
|
double | error (const Values &continuousValues, const DiscreteValues &discreteValues) const |
| Compute error of factor given both continuous and discrete values.
|
|
double | error (const HybridValues &values) const override |
| Compute error of factor given hybrid values.
|
|
size_t | dim () const |
| Get the dimension of the factor (number of rows on linearization).
|
|
GaussianFactor::shared_ptr | linearize (const Values &continuousValues, const DiscreteValues &discreteValues) const |
| Linearize specific nonlinear factors based on the assignment in discreteValues.
|
|
boost::shared_ptr< GaussianMixtureFactor > | linearize (const Values &continuousValues) const |
| Linearize all the continuous factors to get a GaussianMixtureFactor.
|
|
double | nonlinearFactorLogNormalizingConstant (const sharedFactor &factor, const Values &values) const |
| If the component factors are not already normalized, we want to compute their normalizing constants so that the resulting joint distribution is appropriately computed.
|
|
|
void | print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override |
| Testable.
|
|
bool | equals (const HybridFactor &other, double tol=1e-9) const override |
| Check equality.
|
|
| HybridFactor ()=default |
| Default constructor creates empty factor.
|
|
| HybridFactor (const KeyVector &keys) |
| Construct hybrid factor from continuous keys.
|
|
| HybridFactor (const DiscreteKeys &discreteKeys) |
| Construct hybrid factor from discrete keys.
|
|
| HybridFactor (const KeyVector &continuousKeys, const DiscreteKeys &discreteKeys) |
| Construct a new Hybrid Factor object.
|
|
virtual | ~HybridFactor ()=default |
| Virtual destructor.
|
|
bool | isDiscrete () const |
| True if this is a factor of discrete variables only.
|
|
bool | isContinuous () const |
| True if this is a factor of continuous variables only.
|
|
bool | isHybrid () const |
| True is this is a Discrete-Continuous factor.
|
|
size_t | nrContinuous () const |
| Return the number of continuous variables in this factor.
|
|
const DiscreteKeys & | discreteKeys () const |
| Return the discrete keys for this factor.
|
|
const KeyVector & | continuousKeys () const |
| Return only the continuous keys for this 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 |
|
virtual void | printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const |
| print only keys
|
|
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.
|
|
|
| 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.
|
|
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.
|
|
DiscreteKeys | discreteKeys_ |
|
KeyVector | continuousKeys_ |
| Record continuous keys for book-keeping.
|
|
KeyVector | keys_ |
| The keys involved in this factor.
|
|