#include <Expression.h>
Public Types | |
typedef boost::shared_ptr< ExpressionFactor< T > > | shared_ptr |
Public Types inherited from gtsam::NoiseModelFactor | |
typedef boost::shared_ptr< This > | shared_ptr |
Public Types inherited from gtsam::NonlinearFactor | |
typedef boost::shared_ptr< This > | shared_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 | |
gtsam::NonlinearFactor::shared_ptr | clone () const override |
bool | equals (const NonlinearFactor &f, double tol) const override |
equals relies on Testable traits being defined for T More... | |
ExpressionFactor (const SharedNoiseModel &noiseModel, const T &measurement, const Expression< T > &expression) | |
boost::shared_ptr< GaussianFactor > | linearize (const Values &x) const override |
const T & | measured () const |
void | print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override |
print relies on Testable traits being defined for T More... | |
Vector | unwhitenedError (const Values &x, boost::optional< std::vector< Matrix > & > H=boost::none) const override |
~ExpressionFactor () override | |
Destructor. More... | |
Public Member Functions inherited from gtsam::NoiseModelFactor | |
shared_ptr | cloneWithNewNoiseModel (const SharedNoiseModel newNoise) const |
size_t | dim () const override |
bool | equals (const NonlinearFactor &f, double tol=1e-9) const override |
double | error (const Values &c) const override |
boost::shared_ptr< GaussianFactor > | linearize (const Values &x) const override |
const SharedNoiseModel & | noiseModel () const |
access to the noise model More... | |
NoiseModelFactor () | |
template<typename CONTAINER > | |
NoiseModelFactor (const SharedNoiseModel &noiseModel, const CONTAINER &keys) | |
void | print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override |
Vector | unweightedWhitenedError (const Values &c) const |
double | weight (const Values &c) const |
Vector | whitenedError (const Values &c) const |
~NoiseModelFactor () override | |
Public Member Functions inherited from gtsam::NonlinearFactor | |
NonlinearFactor () | |
template<typename CONTAINER > | |
NonlinearFactor (const CONTAINER &keys) | |
virtual | ~NonlinearFactor () |
virtual bool | active (const Values &) const |
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... | |
KeyVector & | keys () |
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 KeyVector & | keys () const |
Access the factor's involved variable keys. More... | |
const_iterator | begin () const |
const_iterator | end () const |
size_t | size () const |
Protected Types | |
typedef ExpressionFactor< T > | This |
Protected Types inherited from gtsam::NoiseModelFactor | |
typedef NonlinearFactor | Base |
typedef NoiseModelFactor | This |
Protected Types inherited from gtsam::NonlinearFactor | |
typedef Factor | Base |
typedef NonlinearFactor | This |
Protected Member Functions | |
virtual Expression< T > | expression () const |
ExpressionFactor () | |
ExpressionFactor (const SharedNoiseModel &noiseModel, const T &measurement) | |
Default constructor, for serialization. More... | |
void | initialize (const Expression< T > &expression) |
Initialize with constructor arguments. More... | |
Protected Member Functions inherited from gtsam::NoiseModelFactor | |
NoiseModelFactor (const SharedNoiseModel &noiseModel) | |
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... | |
Protected Attributes | |
FastVector< int > | dims_ |
dimensions of the Jacobian matrices More... | |
Expression< T > | expression_ |
the expression that is AD enabled More... | |
T | measured_ |
the measurement to be compared with the expression More... | |
Protected Attributes inherited from gtsam::NoiseModelFactor | |
SharedNoiseModel | noiseModel_ |
Protected Attributes inherited from gtsam::Factor | |
KeyVector | keys_ |
The keys involved in this factor. More... | |
Static Protected Attributes | |
static const int | Dim = traits<T>::dimension |
Private Types | |
enum | { NeedsToAlign = (sizeof(T) % 16) == 0 } |
Private Member Functions | |
BOOST_CONCEPT_ASSERT ((IsTestable< T >)) | |
template<class Archive > | |
void | load (Archive &ar, const unsigned int) |
template<class Archive > | |
void | save (Archive &ar, const unsigned int) const |
Save to an archive: just saves the base class. More... | |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
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) |
Factor that supports arbitrary expressions via AD.
Arbitrary instances of this template can be directly inserted into a factor graph for optimization. However, to enable the correct (de)serialization of such instances, the user should declare derived classes from this template, implementing expresion(), serialize(), clone(), print(), and defining the corresponding struct traits<NewFactor> : public Testable<NewFactor> {}
.
T | Type for measurements. |
Definition at line 38 of file Expression.h.
typedef boost::shared_ptr<ExpressionFactor<T> > gtsam::ExpressionFactor< T >::shared_ptr |
Definition at line 58 of file ExpressionFactor.h.
|
protected |
Definition at line 49 of file ExpressionFactor.h.
|
private |
Enumerator | |
---|---|
NeedsToAlign |
Definition at line 220 of file ExpressionFactor.h.
|
inline |
Constructor: creates a factor from a measurement and measurement function
noiseModel | the noise model associated with a measurement |
measurement | actual value of the measurement, of type T |
expression | predicts the measurement from Values The keys associated with the factor, returned by keys(), are sorted. |
Definition at line 67 of file ExpressionFactor.h.
|
inlineoverride |
Destructor.
Definition at line 74 of file ExpressionFactor.h.
|
inlineprotected |
Definition at line 157 of file ExpressionFactor.h.
|
inlineprotected |
Default constructor, for serialization.
Constructor for serializable derived classes
Definition at line 161 of file ExpressionFactor.h.
|
private |
|
inlineoverridevirtual |
Reimplemented from gtsam::NonlinearFactor.
Reimplemented in gtsam::RangeFactorWithTransform< A1, A2, T >, and gtsam::RangeFactor< A1, A2, T >.
Definition at line 151 of file ExpressionFactor.h.
|
inlineoverridevirtual |
equals relies on Testable traits being defined for T
Reimplemented from gtsam::NonlinearFactor.
Definition at line 87 of file ExpressionFactor.h.
|
inlineprotectedvirtual |
Recreate expression from keys_ and measured_, used in load below. Needed to deserialize a derived factor
Reimplemented in gtsam::ExpressionFactorN< T, Args >, gtsam::ExpressionFactorN< T, A1, A2 >, gtsam::ExpressionFactorN< gtsam::Point3, gtsam::Rot3, gtsam::Point3, gtsam::Rot3, gtsam::Point3 >, and gtsam::ExpressionFactorN< BearingRange< A1, A2 >, A1, A2 >.
Definition at line 193 of file ExpressionFactor.h.
|
inlineprotected |
Initialize with constructor arguments.
Definition at line 167 of file ExpressionFactor.h.
|
inlineoverridevirtual |
linearize to a GaussianFactor
Implements gtsam::NonlinearFactor.
Definition at line 112 of file ExpressionFactor.h.
|
inlineprivate |
Load from an archive, creating a valid expression using the overloaded [expression] method
Definition at line 208 of file ExpressionFactor.h.
|
inline |
return the measurement
Definition at line 77 of file ExpressionFactor.h.
|
inlineoverridevirtual |
print relies on Testable traits being defined for T
Reimplemented from gtsam::Factor.
Reimplemented in gtsam::RangeFactorWithTransform< A1, A2, T >, gtsam::RangeFactor< A1, A2, T >, and gtsam::BearingFactor< A1, A2, T >.
Definition at line 80 of file ExpressionFactor.h.
|
inlineprivate |
Save to an archive: just saves the base class.
Definition at line 200 of file ExpressionFactor.h.
|
inlineoverridevirtual |
Error function without the NoiseModel, . We override this method to provide both the function evaluation and its derivative(s) in H.
Implements gtsam::NoiseModelFactor.
Definition at line 99 of file ExpressionFactor.h.
|
friend |
Definition at line 217 of file ExpressionFactor.h.
|
staticprotected |
Definition at line 50 of file ExpressionFactor.h.
|
protected |
dimensions of the Jacobian matrices
Definition at line 54 of file ExpressionFactor.h.
|
protected |
the expression that is AD enabled
Definition at line 53 of file ExpressionFactor.h.
|
protected |
the measurement to be compared with the expression
Definition at line 52 of file ExpressionFactor.h.