26 using namespace gtsam;
46 Ordering actual = Ordering::Colamd(symbolicGraph);
53 Ordering actual = Ordering::ColamdConstrainedLast(symbolicGraph, {2, 4});
60 Ordering actual = Ordering::ColamdConstrainedFirst(symbolicGraph, {2, 4});
67 Ordering actual = Ordering::ColamdConstrainedLast(symbolicGraph, {});
72 Ordering actual = Ordering::ColamdConstrainedFirst(symbolicGraph, {});
81 Ordering actual = Ordering::ColamdConstrainedLast(emptyGraph, {2, 4});
85 Ordering actual = Ordering::ColamdConstrainedFirst(emptyGraph, {2, 4});
104 Ordering actual = Ordering::ColamdConstrained(symbolicGraph, constraints);
139 const vector<int> xadjExpected{0, 2, 5, 8, 11, 13, 16, 20,
140 24, 28, 31, 33, 36, 39, 42, 44},
141 adjExpected{1, 5, 0, 2, 6, 1, 3, 7, 2, 4, 8, 3, 9, 0, 6,
142 10, 1, 5, 7, 11, 2, 6, 8, 12, 3, 7, 9, 13, 4, 8,
143 14, 5, 11, 6, 10, 12, 7, 11, 13, 8, 12, 14, 9, 13};
146 EXPECT(adjExpected.size() == mi.
adj().size());
163 const std::vector<int> xadjExpected{0, 1, 4, 6, 8, 10},
164 adjExpected{1, 0, 2, 4, 1, 3, 2, 4, 1, 3};
167 EXPECT(adjExpected.size() == mi.
adj().size());
184 const std::vector<int> xadjExpected{0, 1, 4, 6, 8, 10},
185 adjExpected{1, 0, 2, 4, 1, 3, 2, 4, 1, 3};
188 vector<int> adjAcutal = mi.
adj();
195 EXPECT(adjExpected.size() == mi.
adj().size());
196 EXPECT(adjExpected == adjAcutal);
220 #ifdef GTSAM_SUPPORT_NESTED_DISSECTION 233 const vector<int> xadjExpected{0, 1, 3, 5, 7, 9, 10},
234 adjExpected{1, 0, 2, 1, 3, 2, 4, 3, 5, 4};
236 vector<int> adjAcutal = mi.
adj();
237 vector<int> xadjActual = mi.
xadj();
240 EXPECT(adjExpected.size() == mi.
adj().size());
241 EXPECT(adjExpected == adjAcutal);
243 Ordering metOrder = Ordering::Metis(symbolicGraph);
252 Ordering metOrder2 = Ordering::Metis(symbolicGraph);
256 #ifdef GTSAM_SUPPORT_NESTED_DISSECTION 267 const vector<int> xadjExpected{0, 1, 3, 4}, adjExpected{1, 0, 2, 1};
270 EXPECT(adjExpected.size() == mi.
adj().size());
273 Ordering metis = Ordering::Metis(symbolicGraph);
277 #ifdef GTSAM_SUPPORT_NESTED_DISSECTION 287 #if defined(__APPLE__) 289 Ordering actual = Ordering::Create(Ordering::METIS, symbolicGraph);
297 #elif defined(_WIN32) 299 Ordering actual = Ordering::Create(Ordering::METIS, symbolicGraph);
309 Ordering actual = Ordering::Create(Ordering::METIS, symbolicGraph);
321 #ifdef GTSAM_SUPPORT_NESTED_DISSECTION 325 Ordering actual = Ordering::Create(Ordering::METIS, symbolicGraph);
331 #ifdef GTSAM_SUPPORT_NESTED_DISSECTION 337 Ordering actual = Ordering::Create(Ordering::METIS, symbolicGraph);
355 Ordering actual = Ordering::Create(Ordering::COLAMD, symbolicGraph);
360 #ifdef GTSAM_SUPPORT_NESTED_DISSECTION 363 Ordering actual = Ordering::Create(Ordering::METIS, symbolicGraph);
373 CHECK_EXCEPTION(Ordering::Create(Ordering::CUSTOM, symbolicGraph), runtime_error);
Provides additional testing facilities for common data structures.
static int runAllTests(TestResult &result)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
const std::vector< int32_t > & adj() const
#define CHECK_EXCEPTION(condition, exception_name)
static enum @1107 ordering
const std::vector< int32_t > & xadj() const
void push_factor(Key key)
#define EXPECT(condition)
SymbolicFactorGraph symbolicChain()
TEST(Ordering, constrained_ordering)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.