Go to the documentation of this file.
26 using namespace gtsam;
28 auto model = noiseModel::Unit::Create(1);
34 (Vector7() << 1.5661, 1.2717, 1.2717, -0.0000, 0.5887, -0.0943, 0.0943)
43 FourierBasis::EvaluationFunctor
fx(3, 0);
53 FourierBasis::EvaluationFunctor
fx(3, 0);
57 Matrix13 expectedH(1, 1, 0);
76 for (
size_t i = 0;
i < 16;
i++) {
77 const double x =
i *
M_PI / 8;
96 auto linearizedJacobianFactor =
97 std::dynamic_pointer_cast<JacobianFactor>(linearizedFactor);
98 CHECK(linearizedJacobianFactor);
114 for (
size_t i = 0;
i < 16;
i++) {
137 Matrix actual = FourierBasis::WeightMatrix(3,
X);
145 for (
size_t i = 0;
i < 16;
i++) {
167 const double x = 0.2;
168 Matrix numeric_dTdx = numericalDerivative11<double, double>(
proxy,
x);
171 Matrix D7 = FourierBasis::DifferentiationMatrix(7);
173 FourierBasis::EvaluationFunctor
fx(7,
x);
177 FourierBasis::DerivativeFunctor dfdx(7,
x);
183 using DotShape =
typename FourierBasis::VectorDerivativeFunctor;
187 double h = 2 *
M_PI / 16;
188 Vector2 dotShape(0.5556, -0.8315);
189 DotShape dotShapeFunction(2,
N,
h / 2);
190 Matrix theta = (Matrix32() << 0, 0, 0.7071, 0.7071, 0.7071, -0.7071)
217 const Matrix W = FourierBasis::WeightMatrix(
N,
X);
221 using Eval = FourierBasis::EvaluationFunctor;
227 const Matrix invW =
W.inverse();
230 for (
size_t i = 0;
i < 16;
i++) {
231 const double x =
i *
M_PI / 8;
static int runAllTests(TestResult &result)
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
std::shared_ptr< This > shared_ptr
shared_ptr to this class
#define EXPECT_CORRECT_FACTOR_JACOBIANS(factor, values, numerical_derivative_step, tolerance)
Check the Jacobians produced by a factor against finite differences.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Concept check for values that can be used in unit tests.
Jet< T, N > sin(const Jet< T, N > &f)
#define EXPECT(condition)
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
Factor for enforcing the scalar value of the polynomial BASIS representation at x is the same as the ...
const Vector k3Coefficients
std::shared_ptr< GaussianFactorGraph > linearize(const Values &linearizationPoint) const
Linearize a nonlinear factor graph.
const EIGEN_DEVICE_FUNC ExpReturnType exp() const
const Vector7 k7Coefficients
Jet< T, N > cos(const Jet< T, N > &f)
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
std::shared_ptr< GaussianFactor > linearize(const Values &x) const override
TEST(Basis, BasisEvaluationFunctor)
std::map< double, double > Sequence
Our sequence representation is a map of {x: y} values where y = f(x)
const HybridGaussianFactorGraph & lfg
Evaluate derivatives of a nonlinear factor numerically.
void insert(Key j, const Vector &value)
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
const gtsam::Symbol key('X', 0)
Fit a Basis using least-squares.
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
static double TestFunction(double x)
IsDerived< DERIVEDFACTOR > add(std::shared_ptr< DERIVEDFACTOR > factor)
add is a synonym for push_back.
NonlinearFactorGraph graph
std::uint64_t Key
Integer nonlinear key type.
Fourier decomposition, see e.g. http://mathworld.wolfram.com/FourierSeries.html.
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
Parameters parameters() const
Return Fourier coefficients.
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:07:26