GTSAM  4.0.2
C++ library for smoothing and mapping (SAM)
BasisFactors.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 
19 #pragma once
20 
21 #include <gtsam/basis/Basis.h>
23 
24 namespace gtsam {
25 
38 template <class BASIS>
39 class EvaluationFactor : public FunctorizedFactor<double, Vector> {
40  private:
42 
43  public:
44  EvaluationFactor() {}
45 
55  EvaluationFactor(Key key, double z, const SharedNoiseModel &model,
56  const size_t N, double x)
57  : Base(key, z, model, typename BASIS::EvaluationFunctor(N, x)) {}
58 
70  EvaluationFactor(Key key, double z, const SharedNoiseModel &model,
71  const size_t N, double x, double a, double b)
72  : Base(key, z, model, typename BASIS::EvaluationFunctor(N, x, a, b)) {}
73 
74  virtual ~EvaluationFactor() {}
75 };
76 
94 template <class BASIS, int M>
96  : public FunctorizedFactor<Vector, ParameterMatrix<M>> {
97  private:
99 
100  public:
102 
113  VectorEvaluationFactor(Key key, const Vector &z,
114  const SharedNoiseModel &model, const size_t N,
115  double x)
116  : Base(key, z, model,
117  typename BASIS::template VectorEvaluationFunctor<M>(N, x)) {}
118 
131  VectorEvaluationFactor(Key key, const Vector &z,
132  const SharedNoiseModel &model, const size_t N,
133  double x, double a, double b)
134  : Base(key, z, model,
135  typename BASIS::template VectorEvaluationFunctor<M>(N, x, a, b)) {}
136 
137  virtual ~VectorEvaluationFactor() {}
138 };
139 
159 template <class BASIS, size_t P>
161  : public FunctorizedFactor<double, ParameterMatrix<P>> {
162  private:
164 
165  public:
167 
181  VectorComponentFactor(Key key, const double &z, const SharedNoiseModel &model,
182  const size_t N, size_t i, double x)
183  : Base(key, z, model,
184  typename BASIS::template VectorComponentFunctor<P>(N, i, x)) {}
185 
201  VectorComponentFactor(Key key, const double &z, const SharedNoiseModel &model,
202  const size_t N, size_t i, double x, double a, double b)
203  : Base(
204  key, z, model,
205  typename BASIS::template VectorComponentFunctor<P>(N, i, x, a, b)) {
206  }
207 
208  virtual ~VectorComponentFactor() {}
209 };
210 
228 template <class BASIS, typename T>
230  : public FunctorizedFactor<T, ParameterMatrix<traits<T>::dimension>> {
231  private:
233 
234  public:
236 
248  const size_t N, double x)
249  : Base(key, z, model,
250  typename BASIS::template ManifoldEvaluationFunctor<T>(N, x)) {}
251 
265  const size_t N, double x, double a, double b)
266  : Base(
267  key, z, model,
268  typename BASIS::template ManifoldEvaluationFunctor<T>(N, x, a, b)) {
269  }
270 
271  virtual ~ManifoldEvaluationFactor() {}
272 };
273 
280 template <class BASIS>
282  : public FunctorizedFactor<double, typename BASIS::Parameters> {
283  private:
285 
286  public:
287  DerivativeFactor() {}
288 
299  DerivativeFactor(Key key, const double &z, const SharedNoiseModel &model,
300  const size_t N, double x)
301  : Base(key, z, model, typename BASIS::DerivativeFunctor(N, x)) {}
302 
315  DerivativeFactor(Key key, const double &z, const SharedNoiseModel &model,
316  const size_t N, double x, double a, double b)
317  : Base(key, z, model, typename BASIS::DerivativeFunctor(N, x, a, b)) {}
318 
319  virtual ~DerivativeFactor() {}
320 };
321 
329 template <class BASIS, int M>
331  : public FunctorizedFactor<Vector, ParameterMatrix<M>> {
332  private:
334  using Func = typename BASIS::template VectorDerivativeFunctor<M>;
335 
336  public:
338 
349  VectorDerivativeFactor(Key key, const Vector &z,
350  const SharedNoiseModel &model, const size_t N,
351  double x)
352  : Base(key, z, model, Func(N, x)) {}
353 
366  VectorDerivativeFactor(Key key, const Vector &z,
367  const SharedNoiseModel &model, const size_t N,
368  double x, double a, double b)
369  : Base(key, z, model, Func(N, x, a, b)) {}
370 
371  virtual ~VectorDerivativeFactor() {}
372 };
373 
382 template <class BASIS, int P>
384  : public FunctorizedFactor<double, ParameterMatrix<P>> {
385  private:
387  using Func = typename BASIS::template ComponentDerivativeFunctor<P>;
388 
389  public:
391 
406  const SharedNoiseModel &model, const size_t N,
407  size_t i, double x)
408  : Base(key, z, model, Func(N, i, x)) {}
409 
426  const SharedNoiseModel &model, const size_t N,
427  size_t i, double x, double a, double b)
428  : Base(key, z, model, Func(N, i, x, a, b)) {}
429 
430  virtual ~ComponentDerivativeFactor() {}
431 };
432 
433 } // namespace gtsam
VectorEvaluationFactor(Key key, const Vector &z, const SharedNoiseModel &model, const size_t N, double x, double a, double b)
Construct a new VectorEvaluationFactor object.
Definition: BasisFactors.h:131
Definition: BasisFactors.h:229
Definition: BasisFactors.h:383
VectorComponentFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, size_t i, double x)
Construct a new VectorComponentFactor object.
Definition: BasisFactors.h:181
DerivativeFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new DerivativeFactor object.
Definition: BasisFactors.h:299
Key key() const
Definition: NonlinearFactor.h:582
VectorDerivativeFactor(Key key, const Vector &z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new VectorDerivativeFactor object.
Definition: BasisFactors.h:349
Definition: FunctorizedFactor.h:59
VectorEvaluationFactor(Key key, const Vector &z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new VectorEvaluationFactor object.
Definition: BasisFactors.h:113
Definition: BasisFactors.h:330
ManifoldEvaluationFactor(Key key, const T &z, const SharedNoiseModel &model, const size_t N, double x, double a, double b)
Construct a new ManifoldEvaluationFactor object.
Definition: BasisFactors.h:264
Definition: BasisFactors.h:281
Factor for enforcing the scalar value of the polynomial BASIS representation at x is the same as the ...
Definition: BasisFactors.h:39
Compute an interpolating basis.
EvaluationFactor(Key key, double z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new EvaluationFactor object.
Definition: BasisFactors.h:55
ComponentDerivativeFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, size_t i, double x, double a, double b)
Construct a new ComponentDerivativeFactor object.
Definition: BasisFactors.h:425
Definition: BasisFactors.h:95
Definition: chartTesting.h:28
ManifoldEvaluationFactor(Key key, const T &z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new ManifoldEvaluationFactor object.
Definition: BasisFactors.h:247
VectorComponentFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, size_t i, double x, double a, double b)
Construct a new VectorComponentFactor object.
Definition: BasisFactors.h:201
EvaluationFactor(Key key, double z, const SharedNoiseModel &model, const size_t N, double x, double a, double b)
Construct a new EvaluationFactor object.
Definition: BasisFactors.h:70
VectorDerivativeFactor(Key key, const Vector &z, const SharedNoiseModel &model, const size_t N, double x, double a, double b)
Construct a new VectorDerivativeFactor object.
Definition: BasisFactors.h:366
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102
noiseModel::Base::shared_ptr SharedNoiseModel
Definition: NoiseModel.h:741
Definition: BasisFactors.h:160
ComponentDerivativeFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, size_t i, double x)
Construct a new ComponentDerivativeFactor object.
Definition: BasisFactors.h:405
DerivativeFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, double x, double a, double b)
Construct a new DerivativeFactor object.
Definition: BasisFactors.h:315