24#include <CppUnitLite/TestResult.h>
25#include <CppUnitLite/Test.h>
26#include <CppUnitLite/Failure.h>
32void testLieGroupDerivatives(TestResult& result_,
const std::string& name_,
33 const G& t1,
const G& t2) {
60void testChartDerivatives(TestResult& result_,
const std::string& name_,
61 const G& t1,
const G& t2) {
65 typedef typename T::TangentVector V;
70 V w12 = T::Local(t1, t2);
72 const auto retract = [](
const G& origin,
const V& v,
const OJ& H1,
73 const OJ& H2) {
return T::Retract(origin, v, H1, H2); };
79 const auto local = [](
const G& origin,
const G& other,
const OJ& H1,
80 const OJ& H2) {
return T::Local(origin, other, H1, H2); };
86#define CHECK_LIE_GROUP_DERIVATIVES(t1,t2) \
87 { gtsam::testLieGroupDerivatives(result_, name_, t1, t2); }
89#define CHECK_CHART_DERIVATIVES(t1,t2) \
90 { gtsam::testChartDerivatives(result_, name_, t1, t2); }
Numerical derivative helpers for manifold-valued functions.
Base class and basic functions for Lie types.
internal::MatrixMN< traits< internal::OutputType< Y, F, X1, X2 > >::dimension, N >::type numericalDerivative21(F &&h, const X1 &x1, const X2 &x2, double delta=1e-5)
Compute numerical derivative in argument 1 of binary function.
Definition numericalDerivative.h:236
internal::MatrixMN< traits< internal::OutputType< Y, F, X1, X2, X3, X4 > >::dimension, N >::type numericalDerivative42(F &&h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, double delta=1e-5)
Compute numerical derivative in argument 2 of 4-argument function.
Definition numericalDerivative.h:417
internal::MatrixMN< traits< internal::OutputType< Y, F, X1, X2, X3, X4 > >::dimension, N >::type numericalDerivative41(F &&h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, double delta=1e-5)
Compute numerical derivative in argument 1 of 4-argument function.
Definition numericalDerivative.h:384
Global functions in a separate testing namespace.
Definition chartTesting.h:28
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
equals with an tolerance, prints out message if unequal
Definition Matrix.cpp:39
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition Group.h:37
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition OptionalJacobian.h:40