GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
Public Types | Public Member Functions | Protected Attributes | List of all members
gtsam::Factor Class Reference
Inheritance diagram for gtsam::Factor:
Inheritance graph
[legend]

Public Types

typedef KeyVector::iterator iterator
 Iterator over keys.
 
typedef KeyVector::const_iterator const_iterator
 Const iterator over keys.
 

Public Member Functions

virtual ~Factor ()=default
 Default destructor.
 
Standard Interface
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 KeyVectorkeys () const
 Access the factor's involved variable keys.
 
const_iterator begin () const
 
const_iterator end () const
 
virtual double error (const HybridValues &c) const
 
size_t size () const
 
Testable
virtual void print (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
 print
 
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
 
Advanced Interface
KeyVectorkeys ()
 
iterator begin ()
 
iterator end ()
 

Protected Attributes

KeyVector keys_
 The keys involved in this factor.
 

Standard Constructors

 Factor ()
 
template<typename CONTAINER >
 Factor (const CONTAINER &keys)
 
template<typename ITERATOR >
 Factor (ITERATOR first, ITERATOR last)
 
template<typename CONTAINER >
static Factor FromKeys (const CONTAINER &keys)
 
template<typename ITERATOR >
static Factor FromIterators (ITERATOR first, ITERATOR last)
 

Constructor & Destructor Documentation

◆ Factor() [1/3]

gtsam::Factor::Factor ( )
inlineprotected

Default constructor for I/O

◆ Factor() [2/3]

template<typename CONTAINER >
gtsam::Factor::Factor ( const CONTAINER &  keys)
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.

◆ Factor() [3/3]

template<typename ITERATOR >
gtsam::Factor::Factor ( ITERATOR  first,
ITERATOR  last 
)
inlineprotected

Construct factor from iterator keys. This constructor may be used internally from derived factor constructors, although our code currently does not use this.

Member Function Documentation

◆ begin() [1/2]

const_iterator gtsam::Factor::begin ( ) const
inline

Iterator at beginning of involved variable keys

◆ begin() [2/2]

iterator gtsam::Factor::begin ( )
inline

Iterator at beginning of involved variable keys

◆ end() [1/2]

const_iterator gtsam::Factor::end ( ) const
inline

Iterator at end of involved variable keys

◆ end() [2/2]

iterator gtsam::Factor::end ( )
inline

Iterator at end of involved variable keys

◆ error()

virtual double gtsam::Factor::error ( const HybridValues c) const
virtual

All factor types need to implement an error function. In factor graphs, this is the negative log-likelihood.

Reimplemented in gtsam::DecisionTreeFactor, gtsam::GaussianMixture, gtsam::HybridConditional, gtsam::MixtureFactor, gtsam::GaussianMixtureFactor, gtsam::SymbolicFactor, gtsam::NonlinearFactor, gtsam::DiscreteFactor, and gtsam::GaussianFactor.

◆ FromIterators()

template<typename ITERATOR >
static Factor gtsam::Factor::FromIterators ( ITERATOR  first,
ITERATOR  last 
)
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.

◆ FromKeys()

template<typename CONTAINER >
static Factor gtsam::Factor::FromKeys ( const CONTAINER &  keys)
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.

◆ keys()

KeyVector& gtsam::Factor::keys ( )
inline
Returns
keys involved in this factor

◆ size()

size_t gtsam::Factor::size ( ) const
inline
Returns
the number of variables involved in this factor

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