#include <Expression.h>
Public Types | |
typedef std::shared_ptr< ExpressionFactor< T > > | shared_ptr |
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 |
virtual Vector | unwhitenedError (const Values &x, OptionalMatrixVecType H=nullptr) const=0 |
Vector | unwhitenedError (const Values &x, std::vector< Matrix > &H) const |
~ExpressionFactor () override | |
Destructor. More... | |
Protected Types | |
typedef ExpressionFactor< T > | 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 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... | |
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 >) | |
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.
|
inlineoverride |
Definition at line 156 of file ExpressionFactor.h.
|
inlineoverride |
equals relies on Testable traits being defined for T
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< double, A1, A1 >, gtsam::ExpressionFactorN< typename Range< A1, A1 >::result_type, A1, A1 >, gtsam::ExpressionFactorN< gtsam::Point3, gtsam::Rot3, gtsam::Point3, gtsam::Rot3, gtsam::Point3 >, gtsam::ExpressionFactorN< typename Bearing< A1, A2 >::result_type, A1, A2 >, 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.
|
inlineoverride |
Definition at line 117 of file ExpressionFactor.h.
|
inline |
return the measurement
Definition at line 82 of file ExpressionFactor.h.
|
inlineoverride |
print relies on Testable traits being defined for T
Definition at line 85 of file ExpressionFactor.h.
|
inlineoverride |
Error function without the NoiseModel, . We override this method to provide both the function evaluation and its derivative(s) in H.
Definition at line 104 of file ExpressionFactor.h.
virtual Vector gtsam::NoiseModelFactor::unwhitenedError |
Error function without the NoiseModel, . Override this method to finish implementing an N-way factor. If the optional arguments is specified, it should compute both the function evaluation and its derivative(s) in H.
|
inline |
support taking in the actual vector instead of the pointer as well to get access to this version of the function from derived classes one will need to use the "using" keyword and specify that like this: public: using NoiseModelFactor::unwhitenedError;
Definition at line 263 of file NonlinearFactor.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.