testLieVector.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>
20 #include <gtsam/base/Manifold.h>
21 
22 using namespace gtsam;
23 
26 
27 //******************************************************************************
28 TEST(LieVector , Concept) {
30  BOOST_CONCEPT_ASSERT((IsManifold<LieVector>));
32 }
33 
34 //******************************************************************************
35 TEST(LieVector , Invariants) {
36  Vector v = Vector3(1.0, 2.0, 3.0);
37  LieVector lie1(v), lie2(v);
38  check_manifold_invariants(lie1, lie2);
39 }
40 
41 //******************************************************************************
42 TEST( testLieVector, construction ) {
43  Vector v = Vector3(1.0, 2.0, 3.0);
44  LieVector lie1(v), lie2(v);
45 
46  EXPECT(lie1.dim() == 3);
47  EXPECT(assert_equal(v, lie1.vector()));
48  EXPECT(assert_equal(lie1, lie2));
49 }
50 
51 //******************************************************************************
52 TEST( testLieVector, other_constructors ) {
53  Vector init = Vector2(10.0, 20.0);
54  LieVector exp(init);
55  double data[] = { 10, 20 };
56  LieVector b(2, data);
57  EXPECT(assert_equal(exp, b));
58 }
59 
60 /* ************************************************************************* */
61 int main() {
62  TestResult tr;
63  return TestRegistry::runAllTests(tr);
64 }
65 /* ************************************************************************* */
66 
int main()
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
Eigen::Vector3d Vector3
Definition: Vector.h:43
EIGEN_DEVICE_FUNC const ExpReturnType exp() const
ArrayXcf v
Definition: Cwise_arg.cpp:1
BOOST_CONCEPT_ASSERT((boost::RandomAccessRangeConcept< ListOfOneContainer< int > >))
#define GTSAM_CONCEPT_LIE_INST(T)
Definition: Lie.h:355
Eigen::VectorXd Vector
Definition: Vector.h:38
Base class and basic functions for Manifold types.
#define EXPECT(condition)
Definition: Test.h:151
int data[]
const G & b
Definition: Group.h:83
traits
Definition: chartTesting.h:28
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Definition: Matrix.cpp:42
Eigen::Vector2d Vector2
Definition: Vector.h:42
TEST(LPInitSolver, InfiniteLoopSingleVar)
#define GTSAM_CONCEPT_TESTABLE_INST(T)
Definition: Testable.h:174


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:47:47