gtsam  4.0.0
gtsam::NonlinearEquality< VALUE > Class Template Reference

Detailed Description

template<class VALUE>
class gtsam::NonlinearEquality< VALUE >

An equality factor that forces either one variable to a constant, or a set of variables to be equal to each other.

Depending on flag, throws an error at linearization if the constraints are not met.

Switchable implementation:

  • ALLLOW_ERROR : if we allow that there can be nonzero error, does not throw, and uses gain
  • ONLY_EXACT : throws error at linearization if not at exact feasible point, and infinite error
+ Inheritance diagram for gtsam::NonlinearEquality< VALUE >:

Standard Constructors

 NonlinearEquality (Key j, const T &feasible, const CompareFunction &_compare=boost::bind(traits< T >::Equals, _1, _2, 1e-9))
 Constructor - forces exact evaluation.
 NonlinearEquality (Key j, const T &feasible, double error_gain, const CompareFunction &_compare=boost::bind(traits< T >::Equals, _1, _2, 1e-9))
 Constructor - allows inexact evaluation.


virtual void print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
virtual bool equals (const NonlinearFactor &f, double tol=1e-9) const
 Check if two factors are equal.

Standard Interface

virtual double error (const Values &c) const
 actual error function calculation
Vector evaluateError (const T &xj, boost::optional< Matrix & > H=boost::none) const
 error function
virtual GaussianFactor::shared_ptr linearize (const Values &x) const
 linearize to a GaussianFactor
virtual gtsam::NonlinearFactor::shared_ptr clone () const

Public Member Functions

 NonlinearEquality ()
 default constructor - only for serialization
- Public Member Functions inherited from gtsam::NoiseModelFactor1< VALUE >
 NoiseModelFactor1 ()
 Default constructor for I/O only.
Key key () const
 NoiseModelFactor1 (const SharedNoiseModel &noiseModel, Key key1)
 Constructor. More...
virtual Vector unwhitenedError (const Values &x, boost::optional< std::vector< Matrix > & > H=boost::none) const
 Calls the 1-key specific version of evaluateError, which is pure virtual so must be implemented in the derived class.

Public Attributes

CompareFunction compare_

Public Types

typedef VALUE T
typedef boost::function< bool(const T &, const T &)> CompareFunction
 Function that compares two values.
- Public Types inherited from gtsam::NoiseModelFactor1< VALUE >
typedef VALUE X


class boost::serialization::access
 Serialization function.

Additional Inherited Members

- Protected Types inherited from gtsam::NoiseModelFactor1< VALUE >
typedef NoiseModelFactor Base
typedef NoiseModelFactor1< VALUE > This

Member Function Documentation

◆ clone()

template<class VALUE >
virtual gtsam::NonlinearFactor::shared_ptr gtsam::NonlinearEquality< VALUE >::clone ( ) const
a deep copy of this factor

Reimplemented from gtsam::NonlinearFactor.

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