26 using namespace gtsam;
87 list<int>
keys{5, 6, 7};
108 map<int, set<int> > sets = dsf.
sets();
123 map<int, set<int> > sets = dsf.
sets();
137 map<int, set<int> > sets = dsf.
sets();
183 list<int>
keys{5, 7};
198 set<int>
set = dsf.
set(5);
213 set<int>
set = dsf.
set(5);
221 int func(
const int&
a) {
return a + 10; }
231 expected = expected.
makeSet(15);
232 expected = expected.
makeSet(16);
233 expected = expected.
makeSet(17);
235 EXPECT(actual == expected);
254 EXPECT(actual == expected);
259 static string x1(
"x1"),
x2(
"x2"),
x3(
"x3"),
x4(
"x4");
280 Measurement m11(1,1),m12(1,2),m14(1,4);
281 Measurement m22(2,2),m23(2,3),m25(2,5),m26(2,6);
284 list<Measurement> measurements{m11, m12, m14, m22, m23, m25, m26};
287 typedef pair<Measurement,Measurement> Match;
288 list<Match>
matches{Match(m11, m22), Match(m12, m23), Match(m14, m25),
308 set<Measurement> expected1{m11,m22};
309 set<Measurement> actual1 = dsf.
set(m11);
310 EXPECT(expected1 == actual1);
312 set<Measurement> expected2{m12,m23};
313 set<Measurement> actual2 = dsf.
set(m12);
314 EXPECT(expected2 == actual2);
316 set<Measurement> expected3{m14,m25,m26};
317 set<Measurement> actual3 = dsf.
set(m14);
318 EXPECT(expected3 == actual3);
std::map< KEY, Set > partition(const std::list< KEY > &keys) const
static int runAllTests(TestResult &result)
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
Self makeList(const std::list< KEY > &keys) const
Self makePair(const KEY &key1, const KEY &key2) const
std::map< KEY, Set > sets() const
void makeUnionInPlace(const KEY &key1, const KEY &key2)
GenericMeasurement< Point2, Point2 > Measurement
#define EXPECT(condition)
Self makeUnion(const KEY &key1, const KEY &key2) const
Self makeSet(const KEY &key) const
An implementation of Disjoint set forests (see CLR page 446 and up)
KEY findSet(const KEY &key) const
Pose3 x3(Rot3::Ypr(M_PI/4.0, 0.0, 0.0), l2)
#define LONGS_EQUAL(expected, actual)
DSF map(std::function< KEY(const KEY &)> func) const
#define EXPECT_LONGS_EQUAL(expected, actual)
Set set(const KEY &label) const