testTableFactor.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 
12 /*
13  * testTableFactor.cpp
14  *
15  * @date Feb 15, 2023
16  * @author Yoonwoo Kim
17  */
18 
20 #include <gtsam/base/Testable.h>
26 
27 #include <chrono>
28 #include <random>
29 
30 using namespace std;
31 using namespace gtsam;
32 
33 vector<double> genArr(double dropout, size_t size) {
34  random_device rd;
35  mt19937 g(rd());
36  vector<double> dropoutmask(size); // Chance of 0
37 
38  uniform_int_distribution<> dist(1, 9);
39  auto gen = [&dist, &g]() { return dist(g); };
40  generate(dropoutmask.begin(), dropoutmask.end(), gen);
41 
42  fill_n(dropoutmask.begin(), dropoutmask.size() * (dropout), 0);
43  shuffle(dropoutmask.begin(), dropoutmask.end(), g);
44 
45  return dropoutmask;
46 }
47 
48 map<double, pair<chrono::microseconds, chrono::microseconds>> measureTime(
49  DiscreteKeys keys1, DiscreteKeys keys2, size_t size) {
50  vector<double> dropouts = {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9};
51  map<double, pair<chrono::microseconds, chrono::microseconds>> measured_times;
52 
53  for (auto dropout : dropouts) {
54  vector<double> arr1 = genArr(dropout, size);
55  vector<double> arr2 = genArr(dropout, size);
56  TableFactor f1(keys1, arr1);
57  TableFactor f2(keys2, arr2);
58  DecisionTreeFactor f1_dt(keys1, arr1);
59  DecisionTreeFactor f2_dt(keys2, arr2);
60 
61  // measure time TableFactor
62  auto tb_start = chrono::high_resolution_clock::now();
63  TableFactor actual = f1 * f2;
64  auto tb_end = chrono::high_resolution_clock::now();
65  auto tb_time_diff =
66  chrono::duration_cast<chrono::microseconds>(tb_end - tb_start);
67 
68  // measure time DT
69  auto dt_start = chrono::high_resolution_clock::now();
70  DecisionTreeFactor actual_dt = f1_dt * f2_dt;
71  auto dt_end = chrono::high_resolution_clock::now();
72  auto dt_time_diff =
73  chrono::duration_cast<chrono::microseconds>(dt_end - dt_start);
74 
75  bool flag = true;
76  for (auto assignmentVal : actual_dt.enumerate()) {
77  flag = actual_dt(assignmentVal.first) != actual(assignmentVal.first);
78  if (flag) {
79  std::cout << "something is wrong: " << std::endl;
80  assignmentVal.first.print();
81  std::cout << "dt: " << actual_dt(assignmentVal.first) << std::endl;
82  std::cout << "tb: " << actual(assignmentVal.first) << std::endl;
83  break;
84  }
85  }
86  if (flag) break;
87  measured_times[dropout] = make_pair(tb_time_diff, dt_time_diff);
88  }
89  return measured_times;
90 }
91 
92 void printTime(map<double, pair<chrono::microseconds, chrono::microseconds>>
93  measured_time) {
94  for (auto&& kv : measured_time) {
95  cout << "dropout: " << kv.first
96  << " | TableFactor time: " << kv.second.first.count()
97  << " | DecisionTreeFactor time: " << kv.second.second.count() << endl;
98  }
99 }
100 
101 /* ************************************************************************* */
102 // Check constructors for TableFactor.
103 TEST(TableFactor, constructors) {
104  // Declare a bunch of keys
105  DiscreteKey X(0, 2), Y(1, 3), Z(2, 2), A(3, 5);
106 
107  // Create factors
108  TableFactor f_zeros(A, {0, 0, 0, 0, 1});
109  TableFactor f1(X, {2, 8});
110  TableFactor f2(X & Y, "2 5 3 6 4 7");
111  TableFactor f3(X & Y & Z, "2 5 3 6 4 7 25 55 35 65 45 75");
112  EXPECT_LONGS_EQUAL(1, f1.size());
113  EXPECT_LONGS_EQUAL(2, f2.size());
114  EXPECT_LONGS_EQUAL(3, f3.size());
115 
117  values[0] = 1; // x
118  values[1] = 2; // y
119  values[2] = 1; // z
120  values[3] = 4; // a
121  EXPECT_DOUBLES_EQUAL(1, f_zeros(values), 1e-9);
122  EXPECT_DOUBLES_EQUAL(8, f1(values), 1e-9);
123  EXPECT_DOUBLES_EQUAL(7, f2(values), 1e-9);
124  EXPECT_DOUBLES_EQUAL(75, f3(values), 1e-9);
125 
126  // Assert that error = -log(value)
127  EXPECT_DOUBLES_EQUAL(-log(f1(values)), f1.error(values), 1e-9);
128 
129  // Construct from DiscreteConditional
130  DiscreteConditional conditional(X | Y = "1/1 2/3 1/4");
131  TableFactor f4(conditional);
132  // Manually constructed via inspection and comparison to DecisionTreeFactor
133  TableFactor expected(X & Y, "0.5 0.4 0.2 0.5 0.6 0.8");
135 
136  // Test for 9=3x3 values.
137  DiscreteKey V(0, 3), W(1, 3);
138  DiscreteConditional conditional5(V | W = "1/2/3 5/6/7 9/10/11");
139  TableFactor f5(conditional5);
140  // GTSAM_PRINT(f5);
141  TableFactor expected_f5(
142  X & Y,
143  "0.166667 0.277778 0.3 0.333333 0.333333 0.333333 0.5 0.388889 0.366667");
144  EXPECT(assert_equal(expected_f5, f5, 1e-6));
145 }
146 
147 /* ************************************************************************* */
148 // Check multiplication between two TableFactors.
149 TEST(TableFactor, multiplication) {
150  DiscreteKey v0(0, 2), v1(1, 2), v2(2, 2);
151 
152  // Multiply with a DiscreteDistribution, i.e., Bayes Law!
153  DiscreteDistribution prior(v1 % "1/3");
154  TableFactor f1(v0 & v1, "1 2 3 4");
155  DecisionTreeFactor expected(v0 & v1, "0.25 1.5 0.75 3");
157  f1.toDecisionTreeFactor()));
159 
160  // Multiply two factors
161  TableFactor f2(v1 & v2, "5 6 7 8");
162  TableFactor actual = f1 * f2;
163  TableFactor expected2(v0 & v1 & v2, "5 6 14 16 15 18 28 32");
164  CHECK(assert_equal(expected2, actual));
165 
166  DiscreteKey A(0, 3), B(1, 2), C(2, 2);
167  TableFactor f_zeros1(A & C, "0 0 0 2 0 3");
168  TableFactor f_zeros2(B & C, "4 0 0 5");
169  TableFactor actual_zeros = f_zeros1 * f_zeros2;
170  TableFactor expected3(A & B & C, "0 0 0 0 0 0 0 10 0 0 0 15");
171  CHECK(assert_equal(expected3, actual_zeros));
172 }
173 
174 /* ************************************************************************* */
175 // Benchmark which compares runtime of multiplication of two TableFactors
176 // and two DecisionTreeFactors given sparsity from dense to 90% sparsity.
177 // NOTE: Enable to run.
179  DiscreteKey A(0, 5), B(1, 2), C(2, 5), D(3, 2), E(4, 5), F(5, 2), G(6, 3),
180  H(7, 2), I(8, 5), J(9, 7), K(10, 2), L(11, 3);
181 
182  // 100
183  DiscreteKeys one_1 = {A, B, C, D};
184  DiscreteKeys one_2 = {C, D, E, F};
185  map<double, pair<chrono::microseconds, chrono::microseconds>> time_map_1 =
186  measureTime(one_1, one_2, 100);
187  printTime(time_map_1);
188  // 200
189  DiscreteKeys two_1 = {A, B, C, D, F};
190  DiscreteKeys two_2 = {B, C, D, E, F};
191  map<double, pair<chrono::microseconds, chrono::microseconds>> time_map_2 =
192  measureTime(two_1, two_2, 200);
193  printTime(time_map_2);
194  // 300
195  DiscreteKeys three_1 = {A, B, C, D, G};
196  DiscreteKeys three_2 = {C, D, E, F, G};
197  map<double, pair<chrono::microseconds, chrono::microseconds>> time_map_3 =
198  measureTime(three_1, three_2, 300);
199  printTime(time_map_3);
200  // 400
201  DiscreteKeys four_1 = {A, B, C, D, F, H};
202  DiscreteKeys four_2 = {B, C, D, E, F, H};
203  map<double, pair<chrono::microseconds, chrono::microseconds>> time_map_4 =
204  measureTime(four_1, four_2, 400);
205  printTime(time_map_4);
206  // 500
207  DiscreteKeys five_1 = {A, B, C, D, I};
208  DiscreteKeys five_2 = {C, D, E, F, I};
209  map<double, pair<chrono::microseconds, chrono::microseconds>> time_map_5 =
210  measureTime(five_1, five_2, 500);
211  printTime(time_map_5);
212  // 600
213  DiscreteKeys six_1 = {A, B, C, D, F, G};
214  DiscreteKeys six_2 = {B, C, D, E, F, G};
215  map<double, pair<chrono::microseconds, chrono::microseconds>> time_map_6 =
216  measureTime(six_1, six_2, 600);
217  printTime(time_map_6);
218  // 700
219  DiscreteKeys seven_1 = {A, B, C, D, J};
220  DiscreteKeys seven_2 = {C, D, E, F, J};
221  map<double, pair<chrono::microseconds, chrono::microseconds>> time_map_7 =
222  measureTime(seven_1, seven_2, 700);
223  printTime(time_map_7);
224  // 800
225  DiscreteKeys eight_1 = {A, B, C, D, F, H, K};
226  DiscreteKeys eight_2 = {B, C, D, E, F, H, K};
227  map<double, pair<chrono::microseconds, chrono::microseconds>> time_map_8 =
228  measureTime(eight_1, eight_2, 800);
229  printTime(time_map_8);
230  // 900
231  DiscreteKeys nine_1 = {A, B, C, D, G, L};
232  DiscreteKeys nine_2 = {C, D, E, F, G, L};
233  map<double, pair<chrono::microseconds, chrono::microseconds>> time_map_9 =
234  measureTime(nine_1, nine_2, 900);
235  printTime(time_map_9);
236 }
237 
238 /* ************************************************************************* */
239 // Check sum and max over frontals.
240 TEST(TableFactor, sum_max) {
241  DiscreteKey v0(0, 3), v1(1, 2);
242  TableFactor f1(v0 & v1, "1 2 3 4 5 6");
243 
244  TableFactor expected(v1, "9 12");
245  TableFactor::shared_ptr actual = f1.sum(1);
246  CHECK(assert_equal(expected, *actual, 1e-5));
247 
248  TableFactor expected2(v1, "5 6");
249  TableFactor::shared_ptr actual2 = f1.max(1);
250  CHECK(assert_equal(expected2, *actual2));
251 
252  TableFactor f2(v1 & v0, "1 2 3 4 5 6");
253  TableFactor::shared_ptr actual22 = f2.sum(1);
254 }
255 
256 /* ************************************************************************* */
257 // Check enumerate yields the correct list of assignment/value pairs.
258 TEST(TableFactor, enumerate) {
259  DiscreteKey A(12, 3), B(5, 2);
260  TableFactor f(A & B, "1 2 3 4 5 6");
261  auto actual = f.enumerate();
262  std::vector<std::pair<DiscreteValues, double>> expected;
264  for (size_t a : {0, 1, 2}) {
265  for (size_t b : {0, 1}) {
266  values[12] = a;
267  values[5] = b;
268  expected.emplace_back(values, f(values));
269  }
270  }
271  EXPECT(actual == expected);
272 }
273 
274 /* ************************************************************************* */
275 // Check pruning of the decision tree works as expected.
276 TEST(TableFactor, Prune) {
277  DiscreteKey A(1, 2), B(2, 2), C(3, 2);
278  TableFactor f(A & B & C, "1 5 3 7 2 6 4 8");
279 
280  // Only keep the leaves with the top 5 values.
281  size_t maxNrAssignments = 5;
282  auto pruned5 = f.prune(maxNrAssignments);
283 
284  // Pruned leaves should be 0
285  TableFactor expected(A & B & C, "0 5 0 7 0 6 4 8");
286  EXPECT(assert_equal(expected, pruned5));
287 
288  // Check for more extreme pruning where we only keep the top 2 leaves
289  maxNrAssignments = 2;
290  auto pruned2 = f.prune(maxNrAssignments);
291  TableFactor expected2(A & B & C, "0 0 0 7 0 0 0 8");
292  EXPECT(assert_equal(expected2, pruned2));
293 
294  DiscreteKey D(4, 2);
295  TableFactor factor(
296  D & C & B & A,
297  "0.0 0.0 0.0 0.60658897 0.61241912 0.61241969 0.61247685 0.61247742 0.0 "
298  "0.0 0.0 0.99995287 1.0 1.0 1.0 1.0");
299 
300  TableFactor expected3(D & C & B & A,
301  "0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 "
302  "0.999952870000 1.0 1.0 1.0 1.0");
303  maxNrAssignments = 5;
304  auto pruned3 = factor.prune(maxNrAssignments);
305  EXPECT(assert_equal(expected3, pruned3));
306 }
307 
308 /* ************************************************************************* */
309 // Check markdown representation looks as expected.
311  DiscreteKey A(12, 3), B(5, 2);
312  TableFactor f(A & B, "1 2 3 4 5 6");
313  string expected =
314  "|A|B|value|\n"
315  "|:-:|:-:|:-:|\n"
316  "|0|0|1|\n"
317  "|0|1|2|\n"
318  "|1|0|3|\n"
319  "|1|1|4|\n"
320  "|2|0|5|\n"
321  "|2|1|6|\n";
322  auto formatter = [](Key key) { return key == 12 ? "A" : "B"; };
323  string actual = f.markdown(formatter);
324  EXPECT(actual == expected);
325 }
326 
327 /* ************************************************************************* */
328 // Check markdown representation with a value formatter.
329 TEST(TableFactor, markdownWithValueFormatter) {
330  DiscreteKey A(12, 3), B(5, 2);
331  TableFactor f(A & B, "1 2 3 4 5 6");
332  string expected =
333  "|A|B|value|\n"
334  "|:-:|:-:|:-:|\n"
335  "|Zero|-|1|\n"
336  "|Zero|+|2|\n"
337  "|One|-|3|\n"
338  "|One|+|4|\n"
339  "|Two|-|5|\n"
340  "|Two|+|6|\n";
341  auto keyFormatter = [](Key key) { return key == 12 ? "A" : "B"; };
342  TableFactor::Names names{{12, {"Zero", "One", "Two"}}, {5, {"-", "+"}}};
343  string actual = f.markdown(keyFormatter, names);
344  EXPECT(actual == expected);
345 }
346 
347 /* ************************************************************************* */
348 // Check html representation with a value formatter.
349 TEST(TableFactor, htmlWithValueFormatter) {
350  DiscreteKey A(12, 3), B(5, 2);
351  TableFactor f(A & B, "1 2 3 4 5 6");
352  string expected =
353  "<div>\n"
354  "<table class='TableFactor'>\n"
355  " <thead>\n"
356  " <tr><th>A</th><th>B</th><th>value</th></tr>\n"
357  " </thead>\n"
358  " <tbody>\n"
359  " <tr><th>Zero</th><th>-</th><td>1</td></tr>\n"
360  " <tr><th>Zero</th><th>+</th><td>2</td></tr>\n"
361  " <tr><th>One</th><th>-</th><td>3</td></tr>\n"
362  " <tr><th>One</th><th>+</th><td>4</td></tr>\n"
363  " <tr><th>Two</th><th>-</th><td>5</td></tr>\n"
364  " <tr><th>Two</th><th>+</th><td>6</td></tr>\n"
365  " </tbody>\n"
366  "</table>\n"
367  "</div>";
368  auto keyFormatter = [](Key key) { return key == 12 ? "A" : "B"; };
369  TableFactor::Names names{{12, {"Zero", "One", "Two"}}, {5, {"-", "+"}}};
370  string actual = f.html(keyFormatter, names);
371  EXPECT(actual == expected);
372 }
373 
374 /* ************************************************************************* */
375 TEST(TableFactor, Unary) {
376  // Declare a bunch of keys
377  DiscreteKey X(0, 2), Y(1, 3);
378 
379  // Create factors
380  TableFactor f(X & Y, "2 5 3 6 2 7");
381  auto op = [](const double x) { return 2 * x; };
382  auto g = f.apply(op);
383 
384  TableFactor expected(X & Y, "4 10 6 12 4 14");
386 
387  auto sq_op = [](const double x) { return x * x; };
388  auto g_sq = f.apply(sq_op);
389  TableFactor expected_sq(X & Y, "4 25 9 36 4 49");
390  EXPECT(assert_equal(g_sq, expected_sq));
391 }
392 
393 /* ************************************************************************* */
394 TEST(TableFactor, UnaryAssignment) {
395  // Declare a bunch of keys
396  DiscreteKey X(0, 2), Y(1, 3);
397 
398  // Create factors
399  TableFactor f(X & Y, "2 5 3 6 2 7");
400  auto op = [](const Assignment<Key>& key, const double x) { return 2 * x; };
401  auto g = f.apply(op);
402 
403  TableFactor expected(X & Y, "4 10 6 12 4 14");
405 }
406 
407 /* ************************************************************************* */
408 int main() {
409  TestResult tr;
410  return TestRegistry::runAllTests(tr);
411 }
412 /* ************************************************************************* */
TestRegistry::runAllTests
static int runAllTests(TestResult &result)
Definition: TestRegistry.cpp:27
TEST
TEST(TableFactor, constructors)
Definition: testTableFactor.cpp:103
TEST_DISABLED
TEST_DISABLED(TableFactor, benchmark)
Definition: testTableFactor.cpp:178
H
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange[*:*] noreverse nowriteback set trange[*:*] noreverse nowriteback set urange[*:*] noreverse nowriteback set vrange[*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
Definition: gnuplot_common_settings.hh:74
gtsam::TableFactor
Definition: TableFactor.h:46
gtsam::markdown
string markdown(const DiscreteValues &values, const KeyFormatter &keyFormatter, const DiscreteValues::Names &names)
Free version of markdown.
Definition: DiscreteValues.cpp:130
gtsam::DecisionTreeFactor
Definition: DecisionTreeFactor.h:44
B
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
Definition: bench_gemm.cpp:49
measureTime
map< double, pair< chrono::microseconds, chrono::microseconds > > measureTime(DiscreteKeys keys1, DiscreteKeys keys2, size_t size)
Definition: testTableFactor.cpp:48
benchmark
Definition: benchmark.py:1
D
MatrixXcd D
Definition: EigenSolver_EigenSolver_MatrixType.cpp:14
test_constructor::f1
auto f1
Definition: testHybridNonlinearFactor.cpp:56
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
v0
static const double v0
Definition: testCal3DFisheye.cpp:31
EXPECT_LONGS_EQUAL
#define EXPECT_LONGS_EQUAL(expected, actual)
Definition: Test.h:154
Testable.h
Concept check for values that can be used in unit tests.
EXPECT
#define EXPECT(condition)
Definition: Test.h:150
TestHarness.h
genArr
vector< double > genArr(double dropout, size_t size)
Definition: testTableFactor.cpp:33
b
Scalar * b
Definition: benchVecAdd.cpp:17
gtsam::DiscreteDistribution
Definition: DiscreteDistribution.h:33
gtsam::Y
GaussianFactorGraphValuePair Y
Definition: HybridGaussianProductFactor.cpp:29
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
formatter
const KeyFormatter & formatter
Definition: treeTraversal-inst.h:204
f2
double f2(const Vector2 &x)
Definition: testNumericalDerivative.cpp:56
different_sigmas::values
HybridValues values
Definition: testHybridBayesNet.cpp:245
log
const EIGEN_DEVICE_FUNC LogReturnType log() const
Definition: ArrayCwiseUnaryOps.h:128
X
#define X
Definition: icosphere.cpp:20
gtsam::DiscreteKeys
DiscreteKeys is a set of keys that can be assembled using the & operator.
Definition: DiscreteKey.h:41
DiscreteConditional.h
A
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:48
size
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
printTime
void printTime(map< double, pair< chrono::microseconds, chrono::microseconds >> measured_time)
Definition: testTableFactor.cpp:92
J
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
I
#define I
Definition: main.h:112
Signature.h
signatures for conditional densities
gtsam::TableFactor::prune
TableFactor prune(size_t maxNrAssignments) const
Prune the decision tree of discrete variables.
Definition: TableFactor.cpp:582
cholesky::expected
Matrix expected
Definition: testMatrix.cpp:971
L
MatrixXd L
Definition: LLT_example.cpp:6
gtsam::Assignment< Key >
TableFactor.h
gtsam::symbol_shorthand::F
Key F(std::uint64_t j)
Definition: inference/Symbol.h:153
EXPECT_DOUBLES_EQUAL
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
Definition: Test.h:161
g
void g(const string &key, int i)
Definition: testBTree.cpp:41
serializationTestHelpers.h
TestResult
Definition: TestResult.h:26
key
const gtsam::Symbol key('X', 0)
E
DiscreteKey E(5, 2)
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
process_shonan_timing_results.names
dictionary names
Definition: process_shonan_timing_results.py:175
gtsam::DiscreteConditional
Definition: DiscreteConditional.h:37
main
int main()
Definition: testTableFactor.cpp:408
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
C
Matrix< Scalar, Dynamic, Dynamic > C
Definition: bench_gemm.cpp:50
gtsam
traits
Definition: SFMdata.h:40
K
#define K
Definition: igam.h:8
gtsam::DiscreteValues
Definition: DiscreteValues.h:34
f3
double f3(double x1, double x2)
Definition: testNumericalDerivative.cpp:76
DiscreteDistribution.h
gtsam::symbol_shorthand::W
Key W(std::uint64_t j)
Definition: inference/Symbol.h:170
CHECK
#define CHECK(condition)
Definition: Test.h:108
gtsam::DiscreteKey
std::pair< Key, size_t > DiscreteKey
Definition: DiscreteKey.h:38
std
Definition: BFloat16.h:88
G
JacobiRotation< float > G
Definition: Jacobi_makeGivens.cpp:2
v2
Vector v2
Definition: testSerializationBase.cpp:39
f4
double f4(double x, double y, double z)
Definition: testNumericalDerivative.cpp:105
gtsam::assert_equal
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Definition: Matrix.cpp:40
gtsam::DecisionTreeFactor::enumerate
std::vector< std::pair< DiscreteValues, double > > enumerate() const
Enumerate all values into a map from values to double.
Definition: DecisionTreeFactor.cpp:187
V
MatrixXcd V
Definition: EigenSolver_EigenSolver_MatrixType.cpp:15
different_sigmas::prior
const auto prior
Definition: testHybridBayesNet.cpp:238
gtsam::Key
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:97
Z
#define Z
Definition: icosphere.cpp:21
gtsam::TableFactor::shared_ptr
std::shared_ptr< TableFactor > shared_ptr
Definition: TableFactor.h:93
v1
Vector v1
Definition: testSerializationBase.cpp:38


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