23 using namespace gtsam;
45 EXPECT(check_group_invariants(
p1, p2));
46 EXPECT(check_manifold_invariants(
p1, p2));
93 Point3 r = p +
Point3(0.8, 0, 0);
94 Point3
t = p +
Point3(0, 0.3, -0.4);
102 std::function<double(const Point3&, const Point3&)>
f =
103 [](
const Point3&
p,
const Point3&
q) {
return gtsam::dot(p, q); };
124 std::function<Point3(const Point3&, const Point3&)>
f =
136 Point3 r = p +
Point3(0.8, 0, 0);
143 std::function<Point3(const Point3&, const Point3&)>
f =
144 [](
const Point3&
p,
const Point3&
q) {
return gtsam::cross(p, q); };
163 std::function<Point3(const Point3&)> fn = [](
const Point3&
p) {
return normalize(
p); };
164 Matrix expectedH = numericalDerivative11<Point3, Point3>(fn,
point);
172 std::vector<Point3> a_points{
a1,
a2, a3};
178 Point3 a_mean(2, 2, 2), b_mean(-1, 1, 0);
182 std::vector<Point3Pair> point_pairs{{
a1,
b1}, {
a2,
b2}, {
a3, b3}};
190 return double(point.norm());
208 Point3 P(1., 12.8, -32.),
Q(52.7, 4.9, -13.3);
211 double expectedDistance = 55.542686;
#define GTSAM_CONCEPT_ASSERT(concept)
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
double dot(const V1 &a, const V2 &b)
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 origin
#define DOUBLES_EQUAL(expected, actual, threshold)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Double_ distance(const OrientedPlane3_ &p)
Some functions to compute numerical derivatives.
#define GTSAM_CONCEPT_LIE_INST(T)
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative21(const std::function< Y(const X1 &, const X2 &)> &h, const X1 &x1, const X2 &x2, double delta=1e-5)
static void normalize(Signature::Row &row)
static const Vector2 mean(20, 40)
Scalar EIGEN_BLAS_FUNC() dot(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
Point3 cross(const Point3 &p, const Point3 &q, OptionalJacobian< 3, 3 > H1, OptionalJacobian< 3, 3 > H2)
cross product
#define EXPECT(condition)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
TEST(Point3, Constructor)
Vector::Scalar omega(const Vector &t, const Vector &s, RealScalar angle)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
EIGEN_DEVICE_FUNC const Scalar & q
Point2Pair means(const std::vector< Point2Pair > &abPointPairs)
Calculate the two means of a set of Point2 pairs.
Annotation to mark enums as an arithmetic type.
The quaternion class used to represent 3D orientations and rotations.
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative22(std::function< Y(const X1 &, const X2 &)> h, const X1 &x1, const X2 &x2, double delta=1e-5)
double testFunc(const Point3 &P, const Point3 &Q)
static Point3 P(0.2, 0.7, -2)
double norm3(const Point3 &p, OptionalJacobian< 1, 3 > H)
Distance of the point from the origin, with Jacobian.
Jet< T, N > sqrt(const Jet< T, N > &f)
double distance3(const Point3 &p1, const Point3 &q, OptionalJacobian< 1, 3 > H1, OptionalJacobian< 1, 3 > H2)
distance between two points
double norm_proxy(const Point3 &point)
#define GTSAM_CONCEPT_TESTABLE_INST(T)
std::pair< Point3, Point3 > Point3Pair