Loading...
Searching...
No Matches
gtsam::HybridFactor Class Reference
Hybrid

## Detailed Description

Base class for truly hybrid probabilistic factors.

a mixture of Gaussian and discrete distributions over a set of variables.

Examples:

- MixtureFactor
- GaussianMixtureFactor
- GaussianMixture

Symbolic factors, used to represent a graph structure, such as

Inheritance diagram for gtsam::HybridFactor:

## Public Member Functions

Standard Constructors
| 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.
Testable
virtual bool | equals (const HybridFactor &lf, double tol=1e-9) const
| equals
void | print (const std::string &s="HybridFactor\n", const KeyFormatter &formatter=DefaultKeyFormatter) const override
| print
Standard Interface
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.
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.
virtual double | error (const HybridValues &c) const
| All factor types need to implement an error function.
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.

## Public Types

typedef HybridFactor | This
| This class.
typedef boost::shared_ptr< HybridFactor > | shared_ptr
| shared_ptr to this class
typedef Factor | Base
| Our base class.
Public Types inherited from gtsam::Factor
typedef KeyVector::iterator | iterator
| Iterator over keys.
typedef KeyVector::const_iterator | const_iterator
| Const iterator over keys.

## Protected Attributes

DiscreteKeys | discreteKeys_
KeyVector | continuousKeys_
| Record continuous keys for book-keeping.
Protected Attributes inherited from gtsam::Factor
KeyVector | keys_
| The keys involved in this factor.

## Friends

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

## Additional Inherited Members

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

## Constructor & Destructor Documentation

## HybridFactor() [1/3]

gtsam::HybridFactor::HybridFactor | ( | const KeyVector & | keys | ) |

explicit

Construct hybrid factor from continuous keys.

Parameters

  keys | Vector of continuous keys.

## HybridFactor() [2/3]

gtsam::HybridFactor::HybridFactor | ( | const DiscreteKeys & | discreteKeys | ) |

explicit

Construct hybrid factor from discrete keys.

Parameters

  keys | Vector of discrete keys.

## HybridFactor() [3/3]

gtsam::HybridFactor::HybridFactor | ( | const KeyVector & | continuousKeys,
|  | const DiscreteKeys & | discreteKeys )

Construct a new Hybrid Factor object.

Parameters

  continuousKeys | Vector of keys for continuous variables.
  discreteKeys | Vector of keys for discrete variables.

## Member Function Documentation

## equals()

bool gtsam::HybridFactor::equals | ( | const HybridFactor & | lf,
|  | double | tol = 1e-9 ) const

virtual

equals

Reimplemented in gtsam::GaussianMixture, gtsam::GaussianMixtureFactor, gtsam::HybridConditional, and gtsam::MixtureFactor.

## print()

void gtsam::HybridFactor::print | ( | const std::string & | s = "HybridFactor\n",
|  | const KeyFormatter & | formatter = DefaultKeyFormatter ) const

override virtual

print

Reimplemented from gtsam::Factor.

Reimplemented in gtsam::MixtureFactor.

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

- /build/gtsam-gchP9J/gtsam-4.2.2+dfsg/gtsam/hybrid/HybridFactor.h
- /build/gtsam-gchP9J/gtsam-4.2.2+dfsg/gtsam/hybrid/HybridFactor.cpp