testSimilarity2.cpp
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 #include <gtsam/base/Testable.h>
21 #include <gtsam/base/testLie.h>
23 
24 #include <functional>
25 
26 using namespace std::placeholders;
27 using namespace gtsam;
28 using namespace std;
29 
31 
32 static const Point2 P(0.2, 0.7);
33 static const Rot2 R = Rot2::fromAngle(0.3);
34 static const double s = 4;
35 
36 //******************************************************************************
37 TEST(Similarity2, Concepts) {
39  GTSAM_CONCEPT_ASSERT(IsManifold<Similarity2>);
41 }
42 
43 //******************************************************************************
44 TEST(Similarity2, Constructors) {
45  Similarity2 sim2_Construct1;
46  Similarity2 sim2_Construct2(s);
47  Similarity2 sim2_Construct3(R, P, s);
48  Similarity2 sim2_Construct4(R.matrix(), P, s);
49 }
50 
51 //******************************************************************************
52 TEST(Similarity2, Getters) {
53  Similarity2 sim2_default;
54  EXPECT(assert_equal(Rot2(), sim2_default.rotation()));
55  EXPECT(assert_equal(Point2(0, 0), sim2_default.translation()));
56  EXPECT_DOUBLES_EQUAL(1.0, sim2_default.scale(), 1e-9);
57 }
58 
59 //******************************************************************************
60 int main() {
61  TestResult tr;
62  return TestRegistry::runAllTests(tr);
63 }
64 //******************************************************************************
TestRegistry::runAllTests
static int runAllTests(TestResult &result)
Definition: TestRegistry.cpp:27
s
static const double s
Definition: testSimilarity2.cpp:34
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
GTSAM_CONCEPT_TESTABLE_INST
#define GTSAM_CONCEPT_TESTABLE_INST(T)
Definition: Testable.h:176
Testable.h
Concept check for values that can be used in unit tests.
EXPECT
#define EXPECT(condition)
Definition: Test.h:150
TestHarness.h
TEST
TEST(Similarity2, Concepts)
Definition: testSimilarity2.cpp:37
R
static const Rot2 R
Definition: testSimilarity2.cpp:33
Similarity2.h
Implementation of Similarity2 transform.
gtsam::Rot2::matrix
Matrix2 matrix() const
Definition: Rot2.cpp:85
testLie.h
gtsam::IsGroup
Definition: Group.h:42
numericalDerivative.h
Some functions to compute numerical derivatives.
main
int main()
Definition: testSimilarity2.cpp:60
gtsam::IsLieGroup
Definition: Lie.h:260
gtsam::Point2
Vector2 Point2
Definition: Point2.h:32
gtsam::Similarity2
Definition: Similarity2.h:35
EXPECT_DOUBLES_EQUAL
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
Definition: Test.h:161
TestResult
Definition: TestResult.h:26
gtsam::Similarity2::rotation
Rot2 rotation() const
Return a GTSAM rotation.
Definition: Similarity2.h:178
gtsam::Rot2
Definition: Rot2.h:35
gtsam
traits
Definition: SFMdata.h:40
gtsam::Similarity2::scale
double scale() const
Return the scale.
Definition: Similarity2.h:184
std
Definition: BFloat16.h:88
gtsam::assert_equal
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Definition: Matrix.cpp:40
gtsam::Similarity2::translation
Point2 translation() const
Return a GTSAM translation.
Definition: Similarity2.h:181
GTSAM_CONCEPT_ASSERT
#define GTSAM_CONCEPT_ASSERT(concept)
Definition: base/concepts.h:22
P
static const Point2 P(0.2, 0.7)


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:08:36