testVariableSlots.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 
21 
24 
25 #include <boost/assign/std/vector.hpp>
26 
27 using namespace gtsam;
28 using namespace std;
29 using namespace boost::assign;
30 
31 /* ************************************************************************* */
33 
35  fg.push_factor(2, 3);
36  fg.push_factor(0, 1);
37  fg.push_factor(0, 2);
38  fg.push_factor(5, 9);
39 
40  VariableSlots actual(fg);
41 
42  static const size_t none = numeric_limits<size_t>::max();
44  expected[0] += none, 0, 0, none;
45  expected[1] += none, 1, none, none;
46  expected[2] += 0, none, 1, none;
47  expected[3] += 1, none, none, none;
48  expected[5] += none, none, none, 0;
49  expected[9] += none, none, none, 1;
50 
51  CHECK(assert_equal(expected, actual));
52 }
53 
54 /* ************************************************************************* */
55 int main() {
56  TestResult tr;
57  return TestRegistry::runAllTests(tr);
58 }
59 /* ************************************************************************* */
60 
Provides additional testing facilities for common data structures.
#define CHECK(condition)
Definition: Test.h:109
#define max(a, b)
Definition: datatypes.h:20
static int runAllTests(TestResult &result)
Matrix expected
Definition: testMatrix.cpp:974
Definition: Half.h:150
int main()
VariableSlots describes the structure of a combined factor in terms of where each block comes from in...
traits
Definition: chartTesting.h:28
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Definition: Matrix.cpp:42
TEST(LPInitSolver, InfiniteLoopSingleVar)


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