13 using namespace gtsam;
25 vector<MFAS::KeyPair>
edges = {make_pair(3, 2), make_pair(0, 1), make_pair(3, 1),
26 make_pair(1, 2), make_pair(0, 2), make_pair(3, 0)};
30 vector<double>
weights1 = {2, 1.5, 0.5, 0.25, 1, 0.75};
32 vector<double>
weights2 = {0.5, 0.75, -0.25, 0.75, 1, 0.5};
37 const vector<double> &weights) {
38 map<MFAS::KeyPair, double> edgeWeights;
39 for (
size_t i = 0;
i < edges.size();
i++) {
40 edgeWeights[edges[
i]] = weights[
i];
53 KeyVector gt_ordered_nodes = {0, 1, 3, 2};
56 for (
size_t i = 0;
i < ordered_nodes.size();
i++) {
64 for (
auto &edge :
edges) {
65 if (edge == make_pair(
Key(3),
Key(0)) ||
66 edge == make_pair(
Key(0),
Key(3))) {
83 KeyVector gt_ordered_nodes = {3, 0, 1, 2};
86 for (
size_t i = 0;
i < ordered_nodes.size();
i++) {
94 for (
auto &edge :
edges) {
vector< MFAS::KeyPair > edges
static int runAllTests(TestResult &result)
MFAS class to solve Minimum Feedback Arc Set graph problem.
vector< double > weights1
KeyVector computeOrdering() const
Computes the 1D MFAS ordering of nodes in the graph.
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
TEST(MFAS, OrderingWeights2)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
std::map< KeyPair, double > computeOutlierWeights() const
Computes the outlier weights of the graph. We define the outlier weight of a edge to be zero if the e...
map< MFAS::KeyPair, double > getEdgeWeights(const vector< MFAS::KeyPair > &edges, const vector< double > &weights)
vector< double > weights2
#define EXPECT_LONGS_EQUAL(expected, actual)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
std::uint64_t Key
Integer nonlinear key type.