21 #include <boost/assign/std/list.hpp> 22 #include <boost/assign/std/set.hpp> 30 using namespace gtsam;
68 typedef pair<size_t,size_t> Match;
70 matches += Match(1,2), Match(2,3), Match(4,5), Match(4,6);
74 for(
const Match&
m: matches)
78 size_t rep1 = dsf.
find(1), rep2 = dsf.
find(4);
90 Measurement m11(1,1),m12(1,2),m14(1,4);
91 Measurement m22(2,2),m23(2,3),m25(2,5),m26(2,6);
94 list<Measurement> measurements;
95 measurements += m11,m12,m14, m22,m23,m25,m26;
98 typedef pair<Measurement,Measurement> Match;
100 matches += Match(m11,m22), Match(m12,m23), Match(m14,m25), Match(m14,m26);
104 for(
const Match&
m: matches)
117 typedef pair<size_t,size_t> Match;
119 matches += Match(1,2), Match(2,3), Match(4,5), Match(4,6);
123 for(
const Match&
m: matches)
126 map<size_t, set<size_t> > sets = dsf.
sets();
static int runAllTests(TestResult &result)
void merge(const KEY &x, const KEY &y)
Merge two sets.
KEY find(const KEY &key) const
Given key, find the representative key for the set in which it lives.
GenericMeasurement< Point2, Point2 > Measurement
#define EXPECT(condition)
Small utility class for representing a wrappable pairs of ints.
#define EXPECT_LONGS_EQUAL(expected, actual)
Allow for arbitrary type in DSF.
std::map< KEY, Set > sets() const
return all sets, i.e. a partition of all elements