gtsam
inference
tests
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
19
#include <
CppUnitLite/TestHarness.h
>
20
#include <
gtsam/base/TestableAssertions.h
>
21
22
#include <
gtsam/inference/VariableSlots.h
>
23
#include <
gtsam/symbolic/SymbolicFactorGraph.h
>
24
25
using namespace
gtsam
;
26
using namespace
std
;
27
28
/* ************************************************************************* */
29
TEST
(
VariableSlots
,
constructor
) {
30
31
SymbolicFactorGraph
fg;
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
();
40
VariableSlots
expected
((
SymbolicFactorGraph
()));
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
gtsam::SymbolicFactorGraph::push_factor
void push_factor(Key key)
Definition:
SymbolicFactorGraph.cpp:42
TestRegistry::runAllTests
static int runAllTests(TestResult &result)
Definition:
TestRegistry.cpp:27
gtsam::VariableSlots
Definition:
VariableSlots.h:51
TestHarness.h
TestableAssertions.h
Provides additional testing facilities for common data structures.
gtsam::SymbolicFactorGraph
Definition:
SymbolicFactorGraph.h:61
main
int main()
Definition:
testVariableSlots.cpp:52
cholesky::expected
Matrix expected
Definition:
testMatrix.cpp:971
SymbolicFactorGraph.h
TestResult
Definition:
TestResult.h:26
VariableSlots.h
VariableSlots describes the structure of a combined factor in terms of where each block comes from in...
gtsam
traits
Definition:
SFMdata.h:40
gtsam::TEST
TEST(SmartFactorBase, Pinhole)
Definition:
testSmartFactorBase.cpp:38
constructor
Definition:
init.h:200
CHECK
#define CHECK(condition)
Definition:
Test.h:108
std
Definition:
BFloat16.h:88
gtsam::assert_equal
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Definition:
Matrix.cpp:40
none
Definition:
pytypes.h:1786
max
#define max(a, b)
Definition:
datatypes.h:20
gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:42:03