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 using namespace gtsam;
26 using namespace std;
27 
28 /* ************************************************************************* */
30 
32  fg.push_factor(2, 3);
33  fg.push_factor(0, 1);
34  fg.push_factor(0, 2);
35  fg.push_factor(5, 9);
36 
37  VariableSlots actual(fg);
38 
39  static const size_t none = numeric_limits<size_t>::max();
41  expected[0] = {none, 0, 0, none};
42  expected[1] = {none, 1, none, none};
43  expected[2] = {0, none, 1, none};
44  expected[3] = {1, none, none, none};
45  expected[5] = {none, none, none, 0};
46  expected[9] = {none, none, none, 1};
47 
48  CHECK(assert_equal(expected, actual));
49 }
50 
51 /* ************************************************************************* */
52 int main() {
53  TestResult tr;
54  return TestRegistry::runAllTests(tr);
55 }
56 /* ************************************************************************* */
57 
Provides additional testing facilities for common data structures.
#define CHECK(condition)
Definition: Test.h:108
#define max(a, b)
Definition: datatypes.h:20
static int runAllTests(TestResult &result)
Matrix expected
Definition: testMatrix.cpp:971
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Definition: Matrix.cpp:40
Definition: BFloat16.h:88
Definition: pytypes.h:1614
int main()
VariableSlots describes the structure of a combined factor in terms of where each block comes from in...
traits
Definition: chartTesting.h:28
TEST(SmartFactorBase, Pinhole)


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:39:56