25 #include <boost/assign/std.hpp> 28 using namespace gtsam;
49 Ordering actual = Ordering::Colamd(symbolicGraph);
56 Ordering actual = Ordering::ColamdConstrainedLast(symbolicGraph, list_of(2)(4));
63 Ordering actual = Ordering::ColamdConstrainedFirst(symbolicGraph, list_of(2)(4));
70 Ordering actual = Ordering::ColamdConstrainedLast(symbolicGraph, {});
75 Ordering actual = Ordering::ColamdConstrainedFirst(symbolicGraph, {});
84 Ordering actual = Ordering::ColamdConstrainedLast(emptyGraph, list_of(2)(4));
88 Ordering actual = Ordering::ColamdConstrainedFirst(emptyGraph, list_of(2)(4));
107 Ordering actual = Ordering::ColamdConstrained(symbolicGraph, constraints);
142 vector<int> xadjExpected, adjExpected;
143 xadjExpected += 0, 2, 5, 8, 11, 13, 16, 20, 24, 28, 31, 33, 36, 39, 42, 44;
144 adjExpected += 1, 5, 0, 2, 6, 1, 3, 7, 2, 4, 8, 3, 9, 0, 6, 10, 1, 5, 7, 11, 2, 6, 8, 12, 3, 7, 9, 13, 4, 8, 14, 5, 11, 6, 10, 12, 7, 11, 13, 8, 12, 14, 9, 13;
147 EXPECT(adjExpected.size() == mi.
adj().size());
164 vector<int> xadjExpected, adjExpected;
165 xadjExpected += 0, 1, 4, 6, 8, 10;
166 adjExpected += 1, 0, 2, 4, 1, 3, 2, 4, 1, 3;
169 EXPECT(adjExpected.size() == mi.
adj().size());
186 vector<int> xadjExpected, adjExpected;
187 xadjExpected += 0, 1, 4, 6, 8, 10;
188 adjExpected += 1, 0, 2, 4, 1, 3, 2, 4, 1, 3;
191 vector<int> adjAcutal = mi.
adj();
198 EXPECT(adjExpected.size() == mi.
adj().size());
199 EXPECT(adjExpected == adjAcutal);
203 #ifdef GTSAM_SUPPORT_NESTED_DISSECTION 216 vector<int> xadjExpected, adjExpected;
217 xadjExpected += 0, 1, 3, 5, 7, 9, 10;
218 adjExpected += 1, 0, 2, 1, 3, 2, 4, 3, 5, 4;
220 vector<int> adjAcutal = mi.
adj();
221 vector<int> xadjActual = mi.
xadj();
224 EXPECT(adjExpected.size() == mi.
adj().size());
225 EXPECT(adjExpected == adjAcutal);
227 Ordering metOrder = Ordering::Metis(symbolicGraph);
236 Ordering metOrder2 = Ordering::Metis(symbolicGraph);
240 #ifdef GTSAM_SUPPORT_NESTED_DISSECTION 251 vector<int> xadjExpected, adjExpected;
252 xadjExpected += 0, 1, 3, 4;
253 adjExpected += 1, 0, 2, 1;
256 EXPECT(adjExpected.size() == mi.
adj().size());
259 Ordering metis = Ordering::Metis(symbolicGraph);
263 #ifdef GTSAM_SUPPORT_NESTED_DISSECTION 273 #if !defined(__APPLE__) 275 Ordering actual = Ordering::Create(Ordering::METIS, symbolicGraph);
285 Ordering actual = Ordering::Create(Ordering::METIS, symbolicGraph);
297 #ifdef GTSAM_SUPPORT_NESTED_DISSECTION 301 Ordering actual = Ordering::Create(Ordering::METIS, symbolicGraph);
307 #ifdef GTSAM_SUPPORT_NESTED_DISSECTION 313 Ordering actual = Ordering::Create(Ordering::METIS, symbolicGraph);
331 Ordering actual = Ordering::Create(Ordering::COLAMD, symbolicGraph);
336 #ifdef GTSAM_SUPPORT_NESTED_DISSECTION 339 Ordering actual = Ordering::Create(Ordering::METIS, symbolicGraph);
349 CHECK_EXCEPTION(Ordering::Create(Ordering::CUSTOM, symbolicGraph), runtime_error);
Provides additional testing facilities for common data structures.
static int runAllTests(TestResult &result)
#define CHECK_EXCEPTION(condition, exception_name)
void push_factor(Key key)
#define EXPECT(condition)
const std::vector< int32_t > & xadj() const
SymbolicFactorGraph symbolicChain()
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
TEST(Ordering, constrained_ordering)
const std::vector< int32_t > & adj() const