#include <Expression.h>
Public Types | |
typedef std::shared_ptr< ExpressionFactor< T > > | shared_ptr |
Public Types inherited from gtsam::NoiseModelFactor | |
typedef std::shared_ptr< This > | shared_ptr |
Public Types inherited from gtsam::NonlinearFactor | |
typedef std::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) | |
std::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, OptionalMatrixVecType H=nullptr) 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 |
std::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 |
Vector | unwhitenedError (const Values &x, std::vector< Matrix > &H) 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) | |
double | error (const HybridValues &c) const override |
virtual bool | active (const Values &) const |
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 KeyVector & | keys () 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... | |
KeyVector & | keys () |
iterator | begin () |
iterator | end () |
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) | |
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 | |
GTSAM_CONCEPT_ASSERT (IsTestable< T >) | |
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 36 of file Expression.h.
typedef std::shared_ptr<ExpressionFactor<T> > gtsam::ExpressionFactor< T >::shared_ptr |
Definition at line 63 of file ExpressionFactor.h.
|
protected |
Definition at line 51 of file ExpressionFactor.h.
|
private |
Enumerator | |
---|---|
NeedsToAlign |
Definition at line 227 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 72 of file ExpressionFactor.h.
|
inlineoverride |
Destructor.
Definition at line 79 of file ExpressionFactor.h.
|
inlineprotected |
Definition at line 162 of file ExpressionFactor.h.
|
inlineprotected |
Default constructor, for serialization.
Constructor for serializable derived classes
Definition at line 166 of file ExpressionFactor.h.
|
inlineoverridevirtual |
Reimplemented from gtsam::NonlinearFactor.
Reimplemented in gtsam::RangeFactorWithTransform< A1, A2, T >, and gtsam::RangeFactor< A1, A2, T >.
Definition at line 156 of file ExpressionFactor.h.
|
inlineoverridevirtual |
equals relies on Testable traits being defined for T
Reimplemented from gtsam::NonlinearFactor.
Definition at line 92 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 198 of file ExpressionFactor.h.
|
private |
|
inlineprotected |
Initialize with constructor arguments.
Definition at line 172 of file ExpressionFactor.h.
|
inlineoverridevirtual |
linearize to a GaussianFactor
Implements gtsam::NonlinearFactor.
Definition at line 117 of file ExpressionFactor.h.
|
inline |
return the measurement
Definition at line 82 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 85 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 104 of file ExpressionFactor.h.
|
staticprotected |
Definition at line 52 of file ExpressionFactor.h.
|
protected |
dimensions of the Jacobian matrices
Definition at line 56 of file ExpressionFactor.h.
|
protected |
the expression that is AD enabled
Definition at line 55 of file ExpressionFactor.h.
|
protected |
the measurement to be compared with the expression
Definition at line 54 of file ExpressionFactor.h.