Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
gtsam::AntiFactor Class Reference

#include <AntiFactor.h>

Inheritance diagram for gtsam::AntiFactor:
Inheritance graph
[legend]

Public Types

typedef boost::shared_ptr< AntiFactorshared_ptr
 
- Public Types inherited from gtsam::NonlinearFactor
typedef boost::shared_ptr< Thisshared_ptr
 
- Public Types inherited from gtsam::Factor
typedef KeyVector::const_iterator const_iterator
 Const iterator over keys. More...
 
typedef KeyVector::iterator iterator
 Iterator over keys. More...
 

Public Member Functions

bool active (const Values &c) const override
 
 AntiFactor ()
 
 AntiFactor (NonlinearFactor::shared_ptr factor)
 
gtsam::NonlinearFactor::shared_ptr clone () const override
 
size_t dim () const override
 
bool equals (const NonlinearFactor &expected, double tol=1e-9) const override
 
double error (const Values &c) const override
 
boost::shared_ptr< GaussianFactorlinearize (const Values &c) const override
 
void print (const std::string &s, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
 
 ~AntiFactor () override
 
- Public Member Functions inherited from gtsam::NonlinearFactor
 NonlinearFactor ()
 
template<typename CONTAINER >
 NonlinearFactor (const CONTAINER &keys)
 
virtual ~NonlinearFactor ()
 
shared_ptr rekey (const std::map< Key, Key > &rekey_mapping) const
 
shared_ptr rekey (const KeyVector &new_keys) const
 
- Public Member Functions inherited from gtsam::Factor
virtual ~Factor ()=default
 Default destructor. More...
 
KeyVectorkeys ()
 
iterator begin ()
 
iterator end ()
 
virtual void printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
 print only keys More...
 
Key front () const
 First key. More...
 
Key back () const
 Last key. More...
 
const_iterator find (Key key) const
 find More...
 
const KeyVectorkeys () const
 Access the factor's involved variable keys. More...
 
const_iterator begin () const
 
const_iterator end () const
 
size_t size () const
 

Private Types

typedef NonlinearFactor Base
 
typedef NonlinearFactor::shared_ptr sharedFactor
 
typedef AntiFactor This
 

Private Member Functions

template<class ARCHIVE >
void serialize (ARCHIVE &ar, const unsigned int)
 

Private Attributes

sharedFactor factor_
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Types inherited from gtsam::NonlinearFactor
typedef Factor Base
 
typedef NonlinearFactor This
 
- Protected Member Functions inherited from gtsam::Factor
 Factor ()
 
template<typename CONTAINER >
 Factor (const CONTAINER &keys)
 
template<typename ITERATOR >
 Factor (ITERATOR first, ITERATOR last)
 
bool equals (const This &other, double tol=1e-9) const
 check equality More...
 
- Static Protected Member Functions inherited from gtsam::Factor
template<typename CONTAINER >
static Factor FromKeys (const CONTAINER &keys)
 
template<typename ITERATOR >
static Factor FromIterators (ITERATOR first, ITERATOR last)
 
- Protected Attributes inherited from gtsam::Factor
KeyVector keys_
 The keys involved in this factor. More...
 

Detailed Description

Definition at line 31 of file AntiFactor.h.

Member Typedef Documentation

Definition at line 36 of file AntiFactor.h.

typedef boost::shared_ptr<AntiFactor> gtsam::AntiFactor::shared_ptr

Definition at line 44 of file AntiFactor.h.

Definition at line 37 of file AntiFactor.h.

Definition at line 35 of file AntiFactor.h.

Constructor & Destructor Documentation

gtsam::AntiFactor::AntiFactor ( )
inline

default constructor - only use for serialization

Definition at line 47 of file AntiFactor.h.

gtsam::AntiFactor::AntiFactor ( NonlinearFactor::shared_ptr  factor)
inline

constructor - Creates the equivalent AntiFactor from an existing factor

Definition at line 50 of file AntiFactor.h.

gtsam::AntiFactor::~AntiFactor ( )
inlineoverride

Definition at line 52 of file AntiFactor.h.

Member Function Documentation

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

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.

Definition at line 89 of file AntiFactor.h.

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

Reimplemented from gtsam::NonlinearFactor.

Definition at line 55 of file AntiFactor.h.

size_t gtsam::AntiFactor::dim ( ) const
inlineoverridevirtual

get the dimension of the factor (same as the original factor)

Implements gtsam::NonlinearFactor.

Definition at line 83 of file AntiFactor.h.

bool gtsam::AntiFactor::equals ( const NonlinearFactor expected,
double  tol = 1e-9 
) const
inlineoverridevirtual

equals

Reimplemented from gtsam::NonlinearFactor.

Definition at line 68 of file AntiFactor.h.

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

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.

Definition at line 80 of file AntiFactor.h.

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

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.

Definition at line 97 of file AntiFactor.h.

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

implement functions needed for Testable print

Reimplemented from gtsam::NonlinearFactor.

Definition at line 62 of file AntiFactor.h.

template<class ARCHIVE >
void gtsam::AntiFactor::serialize ( ARCHIVE &  ar,
const unsigned  int 
)
inlineprivate

Definition at line 112 of file AntiFactor.h.

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Serialization function

Definition at line 110 of file AntiFactor.h.

Member Data Documentation

sharedFactor gtsam::AntiFactor::factor_
private

Definition at line 39 of file AntiFactor.h.


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


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:58:03