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

#include <AntiFactor.h>

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

Public Types

typedef std::shared_ptr< AntiFactorshared_ptr
 
- Public Types inherited from gtsam::NonlinearFactor
typedef std::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
 
std::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)
 
double error (const HybridValues &c) const override
 
virtual shared_ptr rekey (const std::map< Key, Key > &rekey_mapping) const
 
virtual shared_ptr rekey (const KeyVector &new_keys) const
 
virtual bool sendable () const
 
- Public Member Functions inherited from gtsam::Factor
virtual ~Factor ()=default
 Default destructor. More...
 
bool empty () const
 Whether the factor is empty (involves zero variables). 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
 
virtual void printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
 print only keys More...
 
bool equals (const This &other, double tol=1e-9) const
 check equality More...
 
KeyVectorkeys ()
 
iterator begin ()
 
iterator end ()
 

Private Types

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

Private Attributes

sharedFactor factor_
 

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

A class for downdating an existing factor from a graph. The AntiFactor returns the same linearized Hessian matrices of the original factor, but with the opposite sign. This effectively cancels out any affects of the original factor during optimization."

Definition at line 31 of file AntiFactor.h.

Member Typedef Documentation

◆ Base

Definition at line 36 of file AntiFactor.h.

◆ shared_ptr

typedef std::shared_ptr<AntiFactor> gtsam::AntiFactor::shared_ptr

Definition at line 44 of file AntiFactor.h.

◆ sharedFactor

Definition at line 37 of file AntiFactor.h.

◆ This

Definition at line 35 of file AntiFactor.h.

Constructor & Destructor Documentation

◆ AntiFactor() [1/2]

gtsam::AntiFactor::AntiFactor ( )
inline

default constructor - only use for serialization

Definition at line 47 of file AntiFactor.h.

◆ AntiFactor() [2/2]

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.

◆ ~AntiFactor()

gtsam::AntiFactor::~AntiFactor ( )
inlineoverride

Definition at line 52 of file AntiFactor.h.

Member Function Documentation

◆ active()

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.

◆ clone()

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.

◆ dim()

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.

◆ equals()

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.

◆ error()

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.

Reimplemented from gtsam::NonlinearFactor.

Definition at line 80 of file AntiFactor.h.

◆ linearize()

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

◆ print()

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.

Member Data Documentation

◆ factor_

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 Fri Nov 1 2024 03:51:00