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 #ifdef 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 
290  double error(const Values& c) const override;
291 
297  std::shared_ptr<GaussianFactor> linearize(const Values& x) const override;
298 
303  shared_ptr cloneWithNewNoiseModel(const SharedNoiseModel newNoise) const;
304 
305  private:
306 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
307 
308  friend class boost::serialization::access;
309  template<class ARCHIVE>
310  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
311  ar & boost::serialization::make_nvp("NonlinearFactor",
312  boost::serialization::base_object<Base>(*this));
313  ar & BOOST_SERIALIZATION_NVP(noiseModel_);
314  }
315 #endif
316 
317 }; // \class NoiseModelFactor
318 
319 /* ************************************************************************* */
320 namespace detail {
333 template <typename, typename...>
335 template <typename T1>
337  using X = T1;
338  using X1 = T1;
339 };
340 template <typename T1, typename T2>
342  using X1 = T1;
343  using X2 = T2;
344 };
345 template <typename T1, typename T2, typename T3>
347  using X1 = T1;
348  using X2 = T2;
349  using X3 = T3;
350 };
351 template <typename T1, typename T2, typename T3, typename T4>
353  using X1 = T1;
354  using X2 = T2;
355  using X3 = T3;
356  using X4 = T4;
357 };
358 template <typename T1, typename T2, typename T3, typename T4, typename T5>
360  using X1 = T1;
361  using X2 = T2;
362  using X3 = T3;
363  using X4 = T4;
364  using X5 = T5;
365 };
366 template <typename T1, typename T2, typename T3, typename T4, typename T5,
367  typename T6, typename... TExtra>
368 struct NoiseModelFactorAliases<T1, T2, T3, T4, T5, T6, TExtra...> {
369  using X1 = T1;
370  using X2 = T2;
371  using X3 = T3;
372  using X4 = T4;
373  using X5 = T5;
374  using X6 = T6;
375 };
376 } // namespace detail
377 
378 /* ************************************************************************* */
431 template <class... ValueTypes>
433  : public NoiseModelFactor,
434  public detail::NoiseModelFactorAliases<ValueTypes...> {
435  public:
437  inline constexpr static auto N = sizeof...(ValueTypes);
438 
440 
441 protected:
443  using This = NoiseModelFactorN<ValueTypes...>;
444 
447 
448  template <typename From, typename To>
449  using IsConvertible =
451 
452  template <int I>
453  using IndexIsValid = typename std::enable_if<(I >= 1) && (I <= N),
454  void>::type; // 1-indexed!
455 
456  template <typename Container>
457  using ContainerElementType =
458  typename std::decay<decltype(*std::declval<Container>().begin())>::type;
459  template <typename Container>
461 
466  template <typename Ret, typename ...Args>
467  using AreAllMatrixRefs = std::enable_if_t<(... &&
469 
470  template<typename Arg>
471  using IsMatrixPointer = std::is_same<typename std::decay_t<Arg>, Matrix*>;
472 
473  template<typename Arg>
474  using IsNullpointer = std::is_same<typename std::decay_t<Arg>, std::nullptr_t>;
475 
480  template <typename Ret, typename ...Args>
481  using AreAllMatrixPtrs = std::enable_if_t<(... &&
483 
485 
486  /* Like std::void_t, except produces `OptionalMatrixType` instead of
487  * `void`. Used to expand fixed-type parameter-packs with same length as
488  * ValueTypes. */
489  template <typename T = void>
491 
492  /* Like std::void_t, except produces `Key` instead of `void`. Used to expand
493  * fixed-type parameter-packs with same length as ValueTypes. */
494  template <typename T>
495  using KeyType = Key;
496 
497  /* Like std::void_t, except produces `Matrix` instead of
498  * `void`. Used to expand fixed-type parameter-packs with same length as
499  * ValueTypes. This helps in creating an evaluateError overload that accepts
500  * Matrices instead of pointers to matrices */
501  template <typename T = void>
503 
504  public:
524  template <int I, typename = IndexIsValid<I>>
525  using ValueType =
526  typename std::tuple_element<I - 1, std::tuple<ValueTypes...>>::type;
527 
528  public:
529 
532 
535 
545  : Base(noiseModel, std::array<Key, N>{keys...}) {}
546 
554  template <typename CONTAINER = std::initializer_list<Key>,
555  typename = IsContainerOfKeys<CONTAINER>>
557  : Base(noiseModel, keys) {
558  if (keys.size() != N) {
559  throw std::invalid_argument(
560  "NoiseModelFactorN: wrong number of keys given");
561  }
562  }
563 
565 
566  ~NoiseModelFactorN() override {}
567 
582  template <int I = 1>
583  inline Key key() const {
584  static_assert(I <= N, "Index out of bounds");
585  return keys_[I - 1];
586  }
587 
590 
608  const Values& x,
609  OptionalMatrixVecType H = nullptr) const override {
611  H);
612  }
613 
617 
640  virtual Vector evaluateError(const ValueTypes&... x,
641  OptionalMatrixTypeT<ValueTypes>... H) const = 0;
642 
650  Vector evaluateError(const ValueTypes&... x, MatrixTypeT<ValueTypes>&... H) const {
651  return evaluateError(x..., (&H)...);
652  }
653 
657 
664  inline Vector evaluateError(const ValueTypes&... x) const {
666  }
667 
672  template <typename... OptionalJacArgs, typename = IndexIsValid<sizeof...(OptionalJacArgs) + 1>>
674  OptionalJacArgs&&... H) const {
675  return evaluateError(x..., (&H)...);
676  }
677 
682  template <typename... OptionalJacArgs, typename = IndexIsValid<sizeof...(OptionalJacArgs) + 1>>
684  OptionalJacArgs&&... H) const {
685  // If they are pointer version, ensure to cast them all to be Matrix* types
686  // This will ensure any arguments inferred as std::nonetype_t are cast to (Matrix*) nullptr
687  // This guides the compiler to the correct overload which is the one that takes pointers
688  return evaluateError(x...,
689  std::forward<OptionalJacArgs>(H)..., static_cast<OptionalMatrixType>(OptionalNone));
690  }
691 
693 
694  private:
701  template <std::size_t... Indices>
704  const Values& x,
705  OptionalMatrixVecType H = nullptr) const {
706  if (this->active(x)) {
707  if (H) {
708  return evaluateError(x.at<ValueTypes>(keys_[Indices])...,
709  (*H)[Indices]...);
710  } else {
711  return evaluateError(x.at<ValueTypes>(keys_[Indices])...);
712  }
713  } else {
714  return Vector::Zero(this->dim());
715  }
716  }
717 
718 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
719 
720  friend class boost::serialization::access;
721  template <class ARCHIVE>
722  void serialize(ARCHIVE& ar, const unsigned int /*version*/) {
723  ar& boost::serialization::make_nvp(
724  "NoiseModelFactor", boost::serialization::base_object<Base>(*this));
725  }
726 #endif
727 
728  public:
731 
732  inline Key key1() const {
733  return key<1>();
734  }
735  template <int I = 2>
736  inline Key key2() const {
737  static_assert(I <= N, "Index out of bounds");
738  return key<2>();
739  }
740  template <int I = 3>
741  inline Key key3() const {
742  static_assert(I <= N, "Index out of bounds");
743  return key<3>();
744  }
745  template <int I = 4>
746  inline Key key4() const {
747  static_assert(I <= N, "Index out of bounds");
748  return key<4>();
749  }
750  template <int I = 5>
751  inline Key key5() const {
752  static_assert(I <= N, "Index out of bounds");
753  return key<5>();
754  }
755  template <int I = 6>
756  inline Key key6() const {
757  static_assert(I <= N, "Index out of bounds");
758  return key<6>();
759  }
760 
762 
763 }; // \class NoiseModelFactorN
764 
765 #define NoiseModelFactor1 NoiseModelFactorN
766 #define NoiseModelFactor2 NoiseModelFactorN
767 #define NoiseModelFactor3 NoiseModelFactorN
768 #define NoiseModelFactor4 NoiseModelFactorN
769 #define NoiseModelFactor5 NoiseModelFactorN
770 #define NoiseModelFactor6 NoiseModelFactorN
771 
772 } // namespace gtsam
gtsam::NoiseModelFactorN::key4
Key key4() const
Definition: NonlinearFactor.h:746
gtsam::detail::NoiseModelFactorAliases
Definition: NonlinearFactor.h:334
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:371
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:356
gtsam::detail::NoiseModelFactorAliases< T1, T2 >
Definition: NonlinearFactor.h:341
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:343
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5, T6, TExtra... >::X1
T1 X1
Definition: NonlinearFactor.h:369
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:348
gtsam::NoiseModelFactorN< POSE, POINT >::IsMatrixPointer
std::is_same< typename std::decay_t< Arg >, Matrix * > IsMatrixPointer
Definition: NonlinearFactor.h:471
keys
const KeyVector keys
Definition: testRegularImplicitSchurFactor.cpp:40
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5, T6, TExtra... >::X2
T2 X2
Definition: NonlinearFactor.h:370
gtsam::NoiseModelFactorN::evaluateError
Vector evaluateError(const ValueTypes &... x) const
Definition: NonlinearFactor.h:664
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< POSE, POINT >::IndexIsValid
typename std::enable_if<(I >=1) &&(I<=N), void >::type IndexIsValid
Definition: NonlinearFactor.h:454
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4 >::X3
T3 X3
Definition: NonlinearFactor.h:355
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:673
detail
Definition: testSerializationNonlinear.cpp:70
gtsam::NoiseModelFactorN::key5
Key key5() const
Definition: NonlinearFactor.h:751
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:363
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< POSE, POINT >::KeyType
Key KeyType
Definition: NonlinearFactor.h:495
utilities.h
gtsam::detail::NoiseModelFactorAliases< T1 >::X
T1 X
Definition: NonlinearFactor.h:337
Factor.h
The base class for all factors.
gtsam::NoiseModelFactorN::unwhitenedError
Vector unwhitenedError(const Values &x, OptionalMatrixVecType H=nullptr) const override
Definition: NonlinearFactor.h:607
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3 >
Definition: NonlinearFactor.h:346
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:702
gtsam::NoiseModelFactorN::N
constexpr static auto N
N is the number of variables (N-way factor)
Definition: NonlinearFactor.h:437
gtsam::NoiseModelFactorN< POSE, POINT >::ContainerElementType
typename std::decay< decltype(*std::declval< Container >().begin())>::type ContainerElementType
Definition: NonlinearFactor.h:458
gtsam::detail::NoiseModelFactorAliases< T1 >::X1
T1 X1
Definition: NonlinearFactor.h:338
gtsam::NoiseModelFactorN< POSE, POINT >::IsConvertible
typename std::enable_if< std::is_convertible< From, To >::value, void >::type IsConvertible
Definition: NonlinearFactor.h:450
gtsam::print
void print(const Matrix &A, const string &s, ostream &stream)
Definition: Matrix.cpp:156
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4 >::X2
T2 X2
Definition: NonlinearFactor.h:354
T4
static const Similarity3 T4(R, P, s)
gtsam::NoiseModelFactorN::NoiseModelFactorN
NoiseModelFactorN(const SharedNoiseModel &noiseModel, CONTAINER keys)
Definition: NonlinearFactor.h:556
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:373
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:683
gtsam::NoiseModelFactorN
Definition: NonlinearFactor.h:432
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4 >::X1
T1 X1
Definition: NonlinearFactor.h:353
gtsam::NoiseModelFactorN< POSE, POINT >::AreAllMatrixPtrs
std::enable_if_t<(... &&(IsMatrixPointer< Args >::value||IsNullpointer< Args >::value)), Ret > AreAllMatrixPtrs
Definition: NonlinearFactor.h:482
gtsam::NoiseModelFactorN::key6
Key key6() const
Definition: NonlinearFactor.h:756
gtsam::make_index_sequence
Definition: base/utilities.h:51
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5 >::X3
T3 X3
Definition: NonlinearFactor.h:362
gtsam::NoiseModelFactorN< POSE, POINT >::IsNullpointer
std::is_same< typename std::decay_t< Arg >, std::nullptr_t > IsNullpointer
Definition: NonlinearFactor.h:474
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:732
gtsam::NoiseModelFactor::Base
NonlinearFactor Base
Definition: NonlinearFactor.h:203
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3 >::X1
T1 X1
Definition: NonlinearFactor.h:347
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:372
gtsam::detail::NoiseModelFactorAliases< T1, T2 >::X1
T1 X1
Definition: NonlinearFactor.h:342
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:360
gtsam::NoiseModelFactorN::key2
Key key2() const
Definition: NonlinearFactor.h:736
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:543
gtsam
traits
Definition: SFMdata.h:40
gtsam::NoiseModelFactorN< POSE, POINT >::MatrixTypeT
Matrix MatrixTypeT
Definition: NonlinearFactor.h:502
gtsam::Testable
Definition: Testable.h:152
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5 >
Definition: NonlinearFactor.h:359
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< POSE, POINT >::OptionalMatrixTypeT
Matrix * OptionalMatrixTypeT
Definition: NonlinearFactor.h:490
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:349
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:534
gtsam::NoiseModelFactorN::key3
Key key3() const
Definition: NonlinearFactor.h:741
gtsam::tol
const G double tol
Definition: Group.h:79
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5 >::X5
T5 X5
Definition: NonlinearFactor.h:364
gtsam::OptionalMatrixType
Matrix * OptionalMatrixType
Definition: NonlinearFactor.h:56
gtsam::NoiseModelFactorN::~NoiseModelFactorN
~NoiseModelFactorN() override
Definition: NonlinearFactor.h:566
gtsam::detail::NoiseModelFactorAliases< T1, T2, T3, T4, T5, T6, TExtra... >::X6
T6 X6
Definition: NonlinearFactor.h:374
gtsam::NoiseModelFactorN::key
Key key() const
Definition: NonlinearFactor.h:583
gtsam::NoiseModelFactorN::evaluateError
Vector evaluateError(const ValueTypes &... x, MatrixTypeT< ValueTypes > &... H) const
Definition: NonlinearFactor.h:650
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< POSE, POINT >::IsContainerOfKeys
IsConvertible< ContainerElementType< Container >, Key > IsContainerOfKeys
Definition: NonlinearFactor.h:460
gtsam::NoiseModelFactorN< POSE, POINT >::ValueType
typename std::tuple_element< I - 1, std::tuple< ValueTypes... > >::type ValueType
Definition: NonlinearFactor.h:526
gtsam::NoiseModelFactorN< POSE, POINT >::AreAllMatrixRefs
std::enable_if_t<(... &&std::is_convertible< Args, Matrix & >::value), Ret > AreAllMatrixRefs
Definition: NonlinearFactor.h:468
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:352
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:361
gtsam::detail::NoiseModelFactorAliases< T1 >
Definition: NonlinearFactor.h:336


gtsam
Author(s):
autogenerated on Thu Dec 19 2024 04:02:02