gtsam 4.2.0
gtsam
Loading...
Searching...
No Matches
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
24namespace gtsam {
25
38template <class BASIS>
39class EvaluationFactor : public FunctorizedFactor<double, Vector> {
40 private:
42
43 public:
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
94template <class BASIS, int M>
96 : public FunctorizedFactor<Vector, ParameterMatrix<M>> {
97 private:
99
100 public:
102
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
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
159template <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
228template <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
280template <class BASIS>
282 : public FunctorizedFactor<double, typename BASIS::Parameters> {
283 private:
285
286 public:
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
329template <class BASIS, int M>
331 : public FunctorizedFactor<Vector, ParameterMatrix<M>> {
332 private:
334 using Func = typename BASIS::template VectorDerivativeFunctor<M>;
335
336 public:
338
350 const SharedNoiseModel &model, const size_t N,
351 double x)
352 : Base(key, z, model, Func(N, x)) {}
353
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
382template <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
Compute an interpolating basis.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
noiseModel::Base::shared_ptr SharedNoiseModel
Aliases.
Definition NoiseModel.h:724
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:100
Factor for enforcing the scalar value of the polynomial BASIS representation at x is the same as the ...
Definition BasisFactors.h:39
EvaluationFactor(Key key, double z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new EvaluationFactor object.
Definition BasisFactors.h:55
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
Unary factor for enforcing BASIS polynomial evaluation on a ParameterMatrix of size (M,...
Definition BasisFactors.h:96
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
VectorEvaluationFactor(Key key, const Vector &z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new VectorEvaluationFactor object.
Definition BasisFactors.h:113
Unary factor for enforcing BASIS polynomial evaluation on a ParameterMatrix of size (P,...
Definition BasisFactors.h:161
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
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
For a measurement value of type T i.e.
Definition BasisFactors.h:230
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
ManifoldEvaluationFactor(Key key, const T &z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new ManifoldEvaluationFactor object.
Definition BasisFactors.h:247
A unary factor which enforces the evaluation of the derivative of a BASIS polynomial at a specified p...
Definition BasisFactors.h:282
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
DerivativeFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new DerivativeFactor object.
Definition BasisFactors.h:299
A unary factor which enforces the evaluation of the derivative of a BASIS polynomial at a specified p...
Definition BasisFactors.h:331
VectorDerivativeFactor(Key key, const Vector &z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new VectorDerivativeFactor object.
Definition BasisFactors.h:349
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
A unary factor which enforces the evaluation of the derivative of a BASIS polynomial is equal to the ...
Definition BasisFactors.h:384
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
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
Factor which evaluates provided unary functor and uses the result to compute error with respect to th...
Definition FunctorizedFactor.h:59
Key key() const
Returns a key.
Definition NonlinearFactor.h:518