gtsam
4.0.0
gtsam
|
This is the base class for all factor types.
It is templated on a KEY type, which will be the type used to label variables. Key types currently in use in gtsam are Index with symbolic (IndexFactor, SymbolicFactorGraph) and Gaussian factors (GaussianFactor, JacobianFactor, HessianFactor, GaussianFactorGraph), and Key with nonlinear factors (NonlinearFactor, NonlinearFactorGraph). though currently only IndexFactor and IndexConditional derive from this class, using Index keys. This class does not store any data other than its keys. Derived classes store data such as matrices and probability tables.
Note that derived classes must redefine the ConditionalType and shared_ptr typedefs to refer to the associated conditional and shared_ptr types of the derived class. See IndexFactor, JacobianFactor, etc. for examples.
This class is not virtual for performance reasons - derived symbolic classes, IndexFactor and IndexConditional, need to be created and destroyed quickly during symbolic elimination. GaussianFactor and NonlinearFactor are virtual.
Standard Constructors | |
Factor () | |
Default constructor for I/O. | |
template<typename CONTAINER > | |
Factor (const CONTAINER &keys) | |
Construct factor from container of keys. More... | |
template<typename ITERATOR > | |
Factor (ITERATOR first, ITERATOR last) | |
Construct factor from iterator keys. More... | |
template<typename CONTAINER > | |
static Factor | FromKeys (const CONTAINER &keys) |
Construct factor from container of keys. More... | |
template<typename ITERATOR > | |
static Factor | FromIterators (ITERATOR first, ITERATOR last) |
Construct factor from iterator keys. More... | |
Standard Interface | |
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 |
Testable | |
bool | equals (const This &other, double tol=1e-9) const |
check equality | |
void | print (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const |
print | |
void | printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const |
print only keys | |
Advanced Interface | |
class | boost::serialization::access |
Serialization function. | |
KeyVector & | keys () |
iterator | begin () |
Iterator at beginning of involved variable keys. | |
iterator | end () |
Iterator at end of involved variable keys. | |
Public Types | |
typedef KeyVector::iterator | iterator |
Iterator over keys. | |
typedef KeyVector::const_iterator | const_iterator |
Const iterator over keys. | |
Protected Attributes | |
KeyVector | keys_ |
The keys involved in this factor. | |
|
inlineexplicitprotected |
Construct factor from container of keys.
This constructor is used internally from derived factor constructors, either from a container of keys or from a boost::assign::list_of.
|
inlineprotected |
Construct factor from iterator keys.
This constructor may be used internally from derived factor constructors, although our code currently does not use this.
|
inlinestaticprotected |
Construct factor from iterator keys.
This is called internally from derived factor static factor methods, as a workaround for not being able to call the protected constructors above.
|
inlinestaticprotected |
Construct factor from container of keys.
This is called internally from derived factor static factor methods, as a workaround for not being able to call the protected constructors above.
|
inline |
|
inline |