|
NonlinearFactor::shared_ptr | clone () const override |
|
Vector | evaluateError (const T ¶ms, boost::optional< Matrix & > H=boost::none) const override |
|
| FunctorizedFactor () |
|
| FunctorizedFactor (Key key, const R &z, const SharedNoiseModel &model, const std::function< R(T, boost::optional< Matrix & >)> func) |
|
| ~FunctorizedFactor () override |
|
|
void | print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override |
| print More...
|
|
bool | equals (const NonlinearFactor &other, double tol=1e-9) const override |
|
| NoiseModelFactor1 () |
|
| NoiseModelFactor1 (const SharedNoiseModel &noiseModel, Key key1) |
|
| ~NoiseModelFactor1 () override |
|
Key | key () const |
|
Vector | unwhitenedError (const Values &x, boost::optional< std::vector< Matrix > & > H=boost::none) const override |
|
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 |
|
| 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 |
|
virtual | ~Factor ()=default |
| Default destructor. 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...
|
|
KeyVector & | keys () |
|
iterator | begin () |
|
iterator | end () |
|
template<typename R, typename T>
class gtsam::FunctorizedFactor< R, T >
Factor which evaluates provided unary functor and uses the result to compute error with respect to the provided measurement.
Template parameters are
- Parameters
-
R | The return type of the functor after evaluation. |
T | The argument type for the functor. |
Example: Key key = Symbol('X', 0); auto model = noiseModel::Isotropic::Sigma(9, 1);
/// Functor that takes a matrix and multiplies every element by m class MultiplyFunctor { double m_; ///< simple multiplier public: MultiplyFunctor(double m) : m_(m) {} Matrix operator()(const Matrix &X, OptionalJacobian<-1, -1> H = boost::none) const { if (H) *H = m_ * Matrix::Identity(X.rows()*X.cols(), X.rows()*X.cols()); return m_ * X; } };
Matrix measurement = Matrix::Identity(3, 3); double multiplier = 2.0;
FunctorizedFactor<Matrix, Matrix> factor(keyX, measurement, model, MultiplyFunctor(multiplier));
Definition at line 59 of file FunctorizedFactor.h.