NonlinearFactor.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
20 // \callgraph
21 
22 #pragma once
23 
24 #include <gtsam/nonlinear/Values.h>
28 #include <gtsam/inference/Factor.h>
30 #include <gtsam/base/utilities.h>
31 
32 #if GTSAM_ENABLE_BOOST_SERIALIZATION
33 #include <boost/serialization/base_object.hpp>
34 #endif
35 #include <cstddef>
36 #include <type_traits>
37 
38 namespace gtsam {
39 
40 /* ************************************************************************* */
41 
50 #define OptionalNone static_cast<gtsam::Matrix*>(nullptr)
51 
57 
62 using OptionalMatrixVecType = std::vector<Matrix>*;
63 
69 class GTSAM_EXPORT NonlinearFactor: public Factor {
70 
71 protected:
72 
73  // Some handy typedefs
74  typedef Factor Base;
76 
77 public:
78 
79  typedef std::shared_ptr<This> shared_ptr;
80 
83 
86 
90  template<typename CONTAINER>
91  NonlinearFactor(const CONTAINER& keys) :
92  Base(keys) {}
93 
97 
99  void print(const std::string& s = "", const KeyFormatter& keyFormatter =
100  DefaultKeyFormatter) const override;
101 
103  virtual bool equals(const NonlinearFactor& f, double tol = 1e-9) const;
104 
108 
121  virtual double error(const Values& c) const;
122 
127  double error(const HybridValues& c) const override;
128 
130  virtual size_t dim() const = 0;
131 
142  virtual bool active(const Values& /*c*/) const { return true; }
143 
145  virtual std::shared_ptr<GaussianFactor>
146  linearize(const Values& c) const = 0;
147 
154  virtual shared_ptr clone() const {
155  // TODO: choose better exception to throw here
156  throw std::runtime_error("NonlinearFactor::clone(): Attempting to clone factor with no clone() implemented!");
157  return shared_ptr();
158  }
159 
165  virtual shared_ptr rekey(const std::map<Key,Key>& rekey_mapping) const;
166 
171  virtual shared_ptr rekey(const KeyVector& new_keys) const;
172 
177  virtual bool sendable() const {
178  return true;
179  }
180 
181 }; // \class NonlinearFactor
182 
184 template<> struct traits<NonlinearFactor> : public Testable<NonlinearFactor> {
185 };
186 
187 /* ************************************************************************* */
198 class GTSAM_EXPORT NoiseModelFactor: public NonlinearFactor {
199 
200 protected:
201 
202  // handy typedefs
205 
208 public:
209 
210  typedef std::shared_ptr<This> shared_ptr;
211 
214 
216  ~NoiseModelFactor() override {}
217 
221  template<typename CONTAINER>
222  NoiseModelFactor(const SharedNoiseModel& noiseModel, const CONTAINER& keys) :
223  Base(keys), noiseModel_(noiseModel) {}
224 
225 protected:
226 
230  NoiseModelFactor(const SharedNoiseModel& noiseModel) : noiseModel_(noiseModel) {}
231 
232 public:
234  void print(const std::string& s = "",
235  const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override;
236 
238  bool equals(const NonlinearFactor& f, double tol = 1e-9) const override;
239 
241  size_t dim() const override {
242  return noiseModel_->dim();
243  }
244 
246  const SharedNoiseModel& noiseModel() const {
247  return noiseModel_;
248  }
249 
256  virtual Vector unwhitenedError(const Values& x, OptionalMatrixVecType H = nullptr) const = 0;
257 
264  Vector unwhitenedError(const Values& x, std::vector<Matrix>& H) const {
265  return unwhitenedError(x, &H);
266  }
267 
272  Vector whitenedError(const Values& c) const;
273 
277  Vector unweightedWhitenedError(const Values& c) const;
278 
282  double weight(const Values& c) const;
283 
285 
292  double error(const Values& c) const override;
293 
299  std::shared_ptr<GaussianFactor> linearize(const Values& x) const override;
300 
305  shared_ptr cloneWithNewNoiseModel(const SharedNoiseModel newNoise) const;
306 
307  private:
308 #if GTSAM_ENABLE_BOOST_SERIALIZATION
309 
310  friend class boost::serialization::access;
311  template<class ARCHIVE>
312  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
313  ar & boost::serialization::make_nvp("NonlinearFactor",
314  boost::serialization::base_object<Base>(*this));
315  ar & BOOST_SERIALIZATION_NVP(noiseModel_);
316  }
317 #endif
318 
319 }; // \class NoiseModelFactor
320 
321 /* ************************************************************************* */
322 namespace detail {
335 template <typename, typename...>
337 template <typename T1>
339  using X = T1;
340  using X1 = T1;
341 };
342 template <typename T1, typename T2>
344  using X1 = T1;
345  using X2 = T2;
346 };
347 template <typename T1, typename T2, typename T3>
349  using X1 = T1;
350  using X2 = T2;
351  using X3 = T3;
352 };
353 template <typename T1, typename T2, typename T3, typename T4>
355  using X1 = T1;
356  using X2 = T2;
357  using X3 = T3;
358  using X4 = T4;
359 };
360 template <typename T1, typename T2, typename T3, typename T4, typename T5>
362  using X1 = T1;
363  using X2 = T2;
364  using X3 = T3;
365  using X4 = T4;
366  using X5 = T5;
367 };
368 template <typename T1, typename T2, typename T3, typename T4, typename T5,
369  typename T6, typename... TExtra>
370 struct NoiseModelFactorAliases<T1, T2, T3, T4, T5, T6, TExtra...> {
371  using X1 = T1;
372  using X2 = T2;
373  using X3 = T3;
374  using X4 = T4;
375  using X5 = T5;
376  using X6 = T6;
377 };
378 } // namespace detail
379 
380 /* ************************************************************************* */
433 template <class... ValueTypes>
435  : public NoiseModelFactor,
436  public detail::NoiseModelFactorAliases<ValueTypes...> {
437  public:
439  inline constexpr static auto N = sizeof...(ValueTypes);
440 
442 
443 protected:
445  using This = NoiseModelFactorN<ValueTypes...>;
446 
449 
450  template <typename From, typename To>
451  using IsConvertible =
453 
454  template <int I>
455  using IndexIsValid = typename std::enable_if<(I >= 1) && (I <= N),
456  void>::type; // 1-indexed!
457 
458  template <typename Container>
459  using ContainerElementType =
460  typename std::decay<decltype(*std::declval<Container>().begin())>::type;
461  template <typename Container>
463 
468  template <typename Ret, typename ...Args>
469  using AreAllMatrixRefs = std::enable_if_t<(... &&
471 
472  template<typename Arg>
473  using IsMatrixPointer = std::is_same<typename std::decay_t<Arg>, Matrix*>;
474 
475  template<typename Arg>
476  using IsNullpointer = std::is_same<typename std::decay_t<Arg>, std::nullptr_t>;
477 
482  template <typename Ret, typename ...Args>
483  using AreAllMatrixPtrs = std::enable_if_t<(... &&
485 
487 
488  /* Like std::void_t, except produces `OptionalMatrixType` instead of
489  * `void`. Used to expand fixed-type parameter-packs with same length as
490  * ValueTypes. */
491  template <typename T = void>
493 
494  /* Like std::void_t, except produces `Key` instead of `void`. Used to expand
495  * fixed-type parameter-packs with same length as ValueTypes. */
496  template <typename T>
497  using KeyType = Key;
498 
499  /* Like std::void_t, except produces `Matrix` instead of
500  * `void`. Used to expand fixed-type parameter-packs with same length as
501  * ValueTypes. This helps in creating an evaluateError overload that accepts
502  * Matrices instead of pointers to matrices */
503  template <typename T = void>
505 
506  public:
526  template <int I, typename = IndexIsValid<I>>
527  using ValueType =
528  typename std::tuple_element<I - 1, std::tuple<ValueTypes...>>::type;
529 
530  public:
531 
534 
537 
547  : Base(noiseModel, std::array<Key, N>{keys...}) {}
548 
556  template <typename CONTAINER = std::initializer_list<Key>,
557  typename = IsContainerOfKeys<CONTAINER>>
559  : Base(noiseModel, keys) {
560  if (keys.size() != N) {
561  throw std::invalid_argument(
562  "NoiseModelFactorN: wrong number of keys given");
563  }
564  }
565 
567 
568  ~NoiseModelFactorN() override {}
569 
584  template <int I = 1>
585  inline Key key() const {
586  static_assert(I <= N, "Index out of bounds");
587  return keys_[I - 1];
588  }
589 
592 
610  const Values& x,
611  OptionalMatrixVecType H = nullptr) const override {
613  H);
614  }
615 
619 
642  virtual Vector evaluateError(const ValueTypes&... x,
643  OptionalMatrixTypeT<ValueTypes>... H) const = 0;
644 
652  Vector evaluateError(const ValueTypes&... x, MatrixTypeT<ValueTypes>&... H) const {
653  return evaluateError(x..., (&H)...);
654  }
655 
659 
666  inline Vector evaluateError(const ValueTypes&... x) const {
668  }
669 
674  template <typename... OptionalJacArgs, typename = IndexIsValid<sizeof...(OptionalJacArgs) + 1>>
676  OptionalJacArgs&&... H) const {
677  return evaluateError(x..., (&H)...);
678  }
679 
684  template <typename... OptionalJacArgs, typename = IndexIsValid<sizeof...(OptionalJacArgs) + 1>>
686  OptionalJacArgs&&... H) const {
687  // If they are pointer version, ensure to cast them all to be Matrix* types
688  // This will ensure any arguments inferred as std::nonetype_t are cast to (Matrix*) nullptr
689  // This guides the compiler to the correct overload which is the one that takes pointers
690  return evaluateError(x...,
691  std::forward<OptionalJacArgs>(H)..., static_cast<OptionalMatrixType>(OptionalNone));
692  }
693 
695 
696  private:
703  template <std::size_t... Indices>
706  const Values& x,
707  OptionalMatrixVecType H = nullptr) const {
708  if (this->active(x)) {
709  if (H) {
710  return evaluateError(x.at<ValueTypes>(keys_[Indices])...,
711  (*H)[Indices]...);
712  } else {
713  return evaluateError(x.at<ValueTypes>(keys_[Indices])...);
714  }
715  } else {
716  return Vector::Zero(this->dim());
717  }
718  }
719 
720 #if GTSAM_ENABLE_BOOST_SERIALIZATION
721 
722  friend class boost::serialization::access;
723  template <class ARCHIVE>
724  void serialize(ARCHIVE& ar, const unsigned int /*version*/) {
725  ar& boost::serialization::make_nvp(
726  "NoiseModelFactor", boost::serialization::base_object<Base>(*this));
727  }
728 #endif
729 
730  public:
733 
734  inline Key key1() const {
735  return key<1>();
736  }
737  template <int I = 2>
738  inline Key key2() const {
739  static_assert(I <= N, "Index out of bounds");
740  return key<2>();
741  }
742  template <int I = 3>
743  inline Key key3() const {
744  static_assert(I <= N, "Index out of bounds");
745  return key<3>();
746  }
747  template <int I = 4>
748  inline Key key4() const {
749  static_assert(I <= N, "Index out of bounds");
750  return key<4>();
751  }
752  template <int I = 5>
753  inline Key key5() const {
754  static_assert(I <= N, "Index out of bounds");
755  return key<5>();
756  }
757  template <int I = 6>
758  inline Key key6() const {
759  static_assert(I <= N, "Index out of bounds");
760  return key<6>();
761  }
762 
764 
765 }; // \class NoiseModelFactorN
766 
767 #define NoiseModelFactor1 NoiseModelFactorN
768 #define NoiseModelFactor2 NoiseModelFactorN
769 #define NoiseModelFactor3 NoiseModelFactorN
770 #define NoiseModelFactor4 NoiseModelFactorN
771 #define NoiseModelFactor5 NoiseModelFactorN
772 #define NoiseModelFactor6 NoiseModelFactorN
773 
774 } // namespace gtsam
gtsam::NoiseModelFactorN::key4
Key key4() const
Definition: NonlinearFactor.h:748
gtsam::detail::NoiseModelFactorAliases
Definition: NonlinearFactor.h:336
H
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange[*:*] noreverse nowriteback set trange[*:*] noreverse nowriteback set urange[*:*] noreverse nowriteback set vrange[*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
Definition: gnuplot_common_settings.hh:74
gtsam::NonlinearFactor::shared_ptr
std::shared_ptr< This > shared_ptr
Definition: NonlinearFactor.h:79
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5, T6, TExtra... >::X3
T3 X3
Definition: NonlinearFactor.h:373
gtsam::NoiseModelFactor::dim
size_t dim() const override
Definition: NonlinearFactor.h:241
gtsam::HybridValues
Definition: HybridValues.h:37
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4 >::X4
T4 X4
Definition: NonlinearFactor.h:358
gtsam::detail::NoiseModelFactorAliases< T1, T2 >
Definition: NonlinearFactor.h:343
gtsam::NoiseModelFactor::NoiseModelFactor
NoiseModelFactor()
Definition: NonlinearFactor.h:213
gtsam.examples.DogLegOptimizerExample.type
type
Definition: DogLegOptimizerExample.py:111
gtsam::detail::NoiseModelFactorAliases< T1, T2 >::X2
T2 X2
Definition: NonlinearFactor.h:345
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5, T6, TExtra... >::X1
T1 X1
Definition: NonlinearFactor.h:371
s
RealScalar s
Definition: level1_cplx_impl.h:126
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3 >::X2
T2 X2
Definition: NonlinearFactor.h:350
gtsam::NoiseModelFactorN< EssentialMatrix, CALIBRATION, CALIBRATION >::IsMatrixPointer
std::is_same< typename std::decay_t< Arg >, Matrix * > IsMatrixPointer
Definition: NonlinearFactor.h:473
keys
const KeyVector keys
Definition: testRegularImplicitSchurFactor.cpp:40
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5, T6, TExtra... >::X2
T2 X2
Definition: NonlinearFactor.h:372
gtsam::NoiseModelFactorN::evaluateError
Vector evaluateError(const ValueTypes &... x) const
Definition: NonlinearFactor.h:666
gtsam::NonlinearFactor::This
NonlinearFactor This
Definition: NonlinearFactor.h:75
c
Scalar Scalar * c
Definition: benchVecAdd.cpp:17
gtsam::NonlinearFactor::sendable
virtual bool sendable() const
Definition: NonlinearFactor.h:177
gtsam::NoiseModelFactorN::evaluateError
virtual Vector evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const =0
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
gtsam::NoiseModelFactorN< EssentialMatrix, CALIBRATION, CALIBRATION >::IndexIsValid
typename std::enable_if<(I >=1) &&(I<=N), void >::type IndexIsValid
Definition: NonlinearFactor.h:456
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4 >::X3
T3 X3
Definition: NonlinearFactor.h:357
T3
static const Pose3 T3(Rot3::Rodrigues(-90, 0, 0), Point3(1, 2, 3))
type
Definition: pytypes.h:1525
gtsam::Matrix
Eigen::MatrixXd Matrix
Definition: base/Matrix.h:39
gtsam::NoiseModelFactorN::evaluateError
AreAllMatrixRefs< Vector, OptionalJacArgs... > evaluateError(const ValueTypes &... x, OptionalJacArgs &&... H) const
Definition: NonlinearFactor.h:675
detail
Definition: testSerializationNonlinear.cpp:70
gtsam::NoiseModelFactorN::key5
Key key5() const
Definition: NonlinearFactor.h:753
gtsam::Factor
Definition: Factor.h:70
gtsam::NoiseModelFactor::shared_ptr
std::shared_ptr< This > shared_ptr
Definition: NonlinearFactor.h:210
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5 >::X4
T4 X4
Definition: NonlinearFactor.h:365
gtsam::NoiseModelFactor::noiseModel_
SharedNoiseModel noiseModel_
Definition: NonlinearFactor.h:206
gtsam::Factor::shared_ptr
std::shared_ptr< Factor > shared_ptr
A shared_ptr to this class.
Definition: Factor.h:76
gtsam::NonlinearFactor::active
virtual bool active(const Values &) const
Definition: NonlinearFactor.h:142
gtsam::Vector
Eigen::VectorXd Vector
Definition: Vector.h:39
gtsam::KeyVector
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:92
gtsam::NoiseModelFactorN< EssentialMatrix, CALIBRATION, CALIBRATION >::KeyType
Key KeyType
Definition: NonlinearFactor.h:497
utilities.h
gtsam::detail::NoiseModelFactorAliases< T1 >::X
T1 X
Definition: NonlinearFactor.h:339
Factor.h
The base class for all factors.
gtsam::NoiseModelFactorN::unwhitenedError
Vector unwhitenedError(const Values &x, OptionalMatrixVecType H=nullptr) const override
Definition: NonlinearFactor.h:609
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3 >
Definition: NonlinearFactor.h:348
gtsam::DefaultKeyFormatter
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Definition: Key.cpp:30
gtsam::NoiseModelFactorN::unwhitenedError
Vector unwhitenedError(gtsam::index_sequence< Indices... >, const Values &x, OptionalMatrixVecType H=nullptr) const
Definition: NonlinearFactor.h:704
gtsam::NoiseModelFactorN::N
constexpr static auto N
N is the number of variables (N-way factor)
Definition: NonlinearFactor.h:439
gtsam::NoiseModelFactorN< EssentialMatrix, CALIBRATION, CALIBRATION >::ContainerElementType
typename std::decay< decltype(*std::declval< Container >().begin())>::type ContainerElementType
Definition: NonlinearFactor.h:460
gtsam::detail::NoiseModelFactorAliases< T1 >::X1
T1 X1
Definition: NonlinearFactor.h:340
gtsam::NoiseModelFactorN< EssentialMatrix, CALIBRATION, CALIBRATION >::IsConvertible
typename std::enable_if< std::is_convertible< From, To >::value, void >::type IsConvertible
Definition: NonlinearFactor.h:452
gtsam::print
void print(const Matrix &A, const string &s, ostream &stream)
Definition: Matrix.cpp:145
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4 >::X2
T2 X2
Definition: NonlinearFactor.h:356
T4
static const Similarity3 T4(R, P, s)
gtsam::NoiseModelFactorN::NoiseModelFactorN
NoiseModelFactorN(const SharedNoiseModel &noiseModel, CONTAINER keys)
Definition: NonlinearFactor.h:558
I
#define I
Definition: main.h:112
gtsam::NonlinearFactor::NonlinearFactor
NonlinearFactor(const CONTAINER &keys)
Definition: NonlinearFactor.h:91
OptionalNone
#define OptionalNone
Definition: NonlinearFactor.h:50
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5, T6, TExtra... >::X5
T5 X5
Definition: NonlinearFactor.h:375
gtsam::NoiseModelFactor::noiseModel
const SharedNoiseModel & noiseModel() const
access to the noise model
Definition: NonlinearFactor.h:246
T6
static const Similarity3 T6(Rot3(), Point3(1, 1, 0), 2)
gtsam::KeyFormatter
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:35
gtsam::NonlinearFactor::Base
Factor Base
Definition: NonlinearFactor.h:74
gtsam::NoiseModelFactorN::evaluateError
AreAllMatrixPtrs< Vector, OptionalJacArgs... > evaluateError(const ValueTypes &... x, OptionalJacArgs &&... H) const
Definition: NonlinearFactor.h:685
gtsam::NoiseModelFactorN
Definition: NonlinearFactor.h:434
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4 >::X1
T1 X1
Definition: NonlinearFactor.h:355
gtsam::NoiseModelFactorN< EssentialMatrix, CALIBRATION, CALIBRATION >::AreAllMatrixPtrs
std::enable_if_t<(... &&(IsMatrixPointer< Args >::value||IsNullpointer< Args >::value)), Ret > AreAllMatrixPtrs
Definition: NonlinearFactor.h:484
gtsam::NoiseModelFactorN::key6
Key key6() const
Definition: NonlinearFactor.h:758
gtsam::make_index_sequence
Definition: base/utilities.h:51
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5 >::X3
T3 X3
Definition: NonlinearFactor.h:364
gtsam::NoiseModelFactorN< EssentialMatrix, CALIBRATION, CALIBRATION >::IsNullpointer
std::is_same< typename std::decay_t< Arg >, std::nullptr_t > IsNullpointer
Definition: NonlinearFactor.h:476
T5
static const Similarity3 T5(R, P, 10)
OptionalJacobian.h
Special class for optional Jacobian arguments.
gtsam::NonlinearFactor::NonlinearFactor
NonlinearFactor()
Definition: NonlinearFactor.h:85
T2
static const Pose3 T2(Rot3::Rodrigues(0.3, 0.2, 0.1), P2)
gtsam::SharedNoiseModel
noiseModel::Base::shared_ptr SharedNoiseModel
Definition: NoiseModel.h:762
gtsam::NoiseModelFactorN::key1
Key key1() const
Definition: NonlinearFactor.h:734
gtsam::NoiseModelFactor::Base
NonlinearFactor Base
Definition: NonlinearFactor.h:203
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3 >::X1
T1 X1
Definition: NonlinearFactor.h:349
size_t
std::size_t size_t
Definition: wrap/pybind11/include/pybind11/detail/common.h:490
gtsam::equals
Definition: Testable.h:112
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5, T6, TExtra... >::X4
T4 X4
Definition: NonlinearFactor.h:374
gtsam::detail::NoiseModelFactorAliases< T1, T2 >::X1
T1 X1
Definition: NonlinearFactor.h:344
JacobianFactor.h
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
gtsam::OptionalMatrixVecType
std::vector< Matrix > * OptionalMatrixVecType
Definition: NonlinearFactor.h:62
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5 >::X1
T1 X1
Definition: NonlinearFactor.h:362
gtsam::NoiseModelFactorN::key2
Key key2() const
Definition: NonlinearFactor.h:738
gtsam::index_sequence
Definition: base/utilities.h:37
array
Definition: numpy.h:821
gtsam::NoiseModelFactorN::NoiseModelFactorN
NoiseModelFactorN(const SharedNoiseModel &noiseModel, KeyType< ValueTypes >... keys)
Definition: NonlinearFactor.h:545
gtsam
traits
Definition: SFMdata.h:40
gtsam::NoiseModelFactorN< EssentialMatrix, CALIBRATION, CALIBRATION >::MatrixTypeT
Matrix MatrixTypeT
Definition: NonlinearFactor.h:504
gtsam::Testable
Definition: Testable.h:152
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5 >
Definition: NonlinearFactor.h:361
gtsam::Factor::keys_
KeyVector keys_
The keys involved in this factor.
Definition: Factor.h:88
error
static double error
Definition: testRot3.cpp:37
gtsam::NoiseModelFactor::NoiseModelFactor
NoiseModelFactor(const SharedNoiseModel &noiseModel, const CONTAINER &keys)
Definition: NonlinearFactor.h:222
NoiseModel.h
gtsam::traits
Definition: Group.h:36
gtsam::NoiseModelFactorN< EssentialMatrix, CALIBRATION, CALIBRATION >::OptionalMatrixTypeT
Matrix * OptionalMatrixTypeT
Definition: NonlinearFactor.h:492
gtsam::NoiseModelFactor
Definition: NonlinearFactor.h:198
gtsam::Values
Definition: Values.h:65
gtsam::Factor::keys
const KeyVector & keys() const
Access the factor's involved variable keys.
Definition: Factor.h:143
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3 >::X3
T3 X3
Definition: NonlinearFactor.h:351
std
Definition: BFloat16.h:88
gtsam::NonlinearFactor
Definition: NonlinearFactor.h:69
gtsam::NoiseModelFactor::This
NoiseModelFactor This
Definition: NonlinearFactor.h:204
gtsam::NoiseModelFactorN::NoiseModelFactorN
NoiseModelFactorN()
Default Constructor for I/O.
Definition: NonlinearFactor.h:536
gtsam::NoiseModelFactorN::key3
Key key3() const
Definition: NonlinearFactor.h:743
gtsam::tol
const G double tol
Definition: Group.h:79
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5 >::X5
T5 X5
Definition: NonlinearFactor.h:366
gtsam::OptionalMatrixType
Matrix * OptionalMatrixType
Definition: NonlinearFactor.h:56
gtsam::NoiseModelFactorN::~NoiseModelFactorN
~NoiseModelFactorN() override
Definition: NonlinearFactor.h:568
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5, T6, TExtra... >::X6
T6 X6
Definition: NonlinearFactor.h:376
gtsam::NoiseModelFactorN::key
Key key() const
Definition: NonlinearFactor.h:585
gtsam::NoiseModelFactorN::evaluateError
Vector evaluateError(const ValueTypes &... x, MatrixTypeT< ValueTypes > &... H) const
Definition: NonlinearFactor.h:652
T1
static const Similarity3 T1(R, Point3(3.5, -8.2, 4.2), 1)
Indices
std::vector< size_t > Indices
Definition: testPartialPriorFactor.cpp:37
gtsam::NoiseModelFactorN< EssentialMatrix, CALIBRATION, CALIBRATION >::IsContainerOfKeys
IsConvertible< ContainerElementType< Container >, Key > IsContainerOfKeys
Definition: NonlinearFactor.h:462
gtsam::NoiseModelFactorN< EssentialMatrix, CALIBRATION, CALIBRATION >::ValueType
typename std::tuple_element< I - 1, std::tuple< ValueTypes... > >::type ValueType
Definition: NonlinearFactor.h:528
gtsam::NoiseModelFactorN< EssentialMatrix, CALIBRATION, CALIBRATION >::AreAllMatrixRefs
std::enable_if_t<(... &&std::is_convertible< Args, Matrix & >::value), Ret > AreAllMatrixRefs
Definition: NonlinearFactor.h:470
gtsam::Key
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:97
gtsam::NonlinearFactor::clone
virtual shared_ptr clone() const
Definition: NonlinearFactor.h:154
HybridValues.h
enable_if_t
typename std::enable_if< B, T >::type enable_if_t
from cpp_future import (convenient aliases from C++14/17)
Definition: wrap/pybind11/include/pybind11/detail/common.h:654
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4 >
Definition: NonlinearFactor.h:354
gtsam::NoiseModelFactor::unwhitenedError
virtual Vector unwhitenedError(const Values &x, OptionalMatrixVecType H=nullptr) const =0
test_callbacks.value
value
Definition: test_callbacks.py:160
gtsam::NoiseModelFactor::NoiseModelFactor
NoiseModelFactor(const SharedNoiseModel &noiseModel)
Definition: NonlinearFactor.h:230
gtsam::NoiseModelFactor::~NoiseModelFactor
~NoiseModelFactor() override
Definition: NonlinearFactor.h:216
Values.h
A non-templated config holding any types of Manifold-group elements.
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5 >::X2
T2 X2
Definition: NonlinearFactor.h:363
gtsam::detail::NoiseModelFactorAliases< T1 >
Definition: NonlinearFactor.h:338
gtsam::NonlinearFactor::error
virtual double error(const Values &c) const
Definition: NonlinearFactor.cpp:27


gtsam
Author(s):
autogenerated on Wed Jan 22 2025 04:02:22