gtsam  3.2.0
gtsam
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gtsam::AntiFactor Class Reference
+ Inheritance diagram for gtsam::AntiFactor:

Public Member Functions

 AntiFactor ()
 default constructor - only use for serialization
 
 AntiFactor (NonlinearFactor::shared_ptr factor)
 constructor - Creates the equivalent AntiFactor from an existing factor
 
virtual
gtsam::NonlinearFactor::shared_ptr 
clone () const
 
virtual void print (const std::string &s, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
 implement functions needed for Testable More...
 
virtual bool equals (const NonlinearFactor &expected, double tol=1e-9) const
 equals
 
double error (const Values &c) const
 implement functions needed to derive from Factor More...
 
size_t dim () const
 get the dimension of the factor (same as the original factor)
 
bool active (const Values &c) const
 Checks whether this factor should be used based on a set of values. More...
 
boost::shared_ptr< GaussianFactorlinearize (const Values &c) const
 Linearize to a GaussianFactor. More...
 
- Public Member Functions inherited from gtsam::NonlinearFactor
 NonlinearFactor ()
 Default constructor for I/O only.
 
template<typename CONTAINER >
 NonlinearFactor (const CONTAINER &keys)
 Constructor from a collection of the keys involved in this factor.
 
virtual ~NonlinearFactor ()
 Destructor.
 
shared_ptr rekey (const std::map< Key, Key > &rekey_mapping) const
 Creates a shared_ptr clone of the factor with different keys using a map from old->new keys.
 
shared_ptr rekey (const std::vector< Key > &new_keys) const
 Clones a factor and fully replaces its keys. More...
 
- Public Member Functions inherited from gtsam::Factor
Key front () const
 First key.
 
Key back () const
 Last key.
 
const_iterator find (Key key) const
 find
 
const FastVector< Key > & 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
 
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
 
FastVector< Key > & keys ()
 
iterator begin ()
 Iterator at beginning of involved variable keys.
 
iterator end ()
 Iterator at end of involved variable keys.
 

Public Types

typedef boost::shared_ptr
< AntiFactor
shared_ptr
 
- Public Types inherited from gtsam::NonlinearFactor
typedef boost::shared_ptr< Thisshared_ptr
 
- Public Types inherited from gtsam::Factor
typedef FastVector< Key >::iterator iterator
 Iterator over keys.
 
typedef FastVector< Key >
::const_iterator 
const_iterator
 Const iterator over keys.
 

Friends

class boost::serialization::access
 Serialization function.
 

Additional Inherited Members

- Protected Types inherited from gtsam::NonlinearFactor
typedef Factor Base
 
typedef NonlinearFactor This
 
- Protected Member Functions inherited from gtsam::Factor
 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...
 
bool equals (const This &other, double tol=1e-9) const
 check equality
 
- Static Protected Member Functions inherited from gtsam::Factor
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...
 
- Protected Attributes inherited from gtsam::Factor
FastVector< Keykeys_
 The keys involved in this factor.
 

Member Function Documentation

bool gtsam::AntiFactor::active ( const Values c) const
inlinevirtual

Checks whether this factor should be used based on a set of values.

The AntiFactor will have the same 'active' profile as the original factor.

Reimplemented from gtsam::NonlinearFactor.

virtual gtsam::NonlinearFactor::shared_ptr gtsam::AntiFactor::clone ( ) const
inlinevirtual
Returns
a deep copy of this factor

Reimplemented from gtsam::NonlinearFactor.

double gtsam::AntiFactor::error ( const Values c) const
inlinevirtual

implement functions needed to derive from Factor

Calculate the error of the factor For the AntiFactor, this will have the same magnitude of the original factor, but the opposite sign.

Implements gtsam::NonlinearFactor.

boost::shared_ptr<GaussianFactor> gtsam::AntiFactor::linearize ( const Values c) const
inlinevirtual

Linearize to a GaussianFactor.

The AntiFactor always returns a Hessian Factor with the same Hessian matrices as the original factor (even if the original factor returns a Jacobian instead of a full Hessian), but with the opposite sign. This effectively cancels the effect of the original factor on the factor graph.

Implements gtsam::NonlinearFactor.

virtual void gtsam::AntiFactor::print ( const std::string &  s,
const KeyFormatter keyFormatter = DefaultKeyFormatter 
) const
inlinevirtual

implement functions needed for Testable

print

Reimplemented from gtsam::NonlinearFactor.


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