diff options
-rw-r--r-- | rbmp.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -114,6 +114,18 @@ int main(int argc, char* argv[]) { pm.options.verbose = false; pm.Solve(); + std::cout << n << std::endl; + + for (unsigned i = 0; i < G.vertices.size() / 2; i++) { + unsigned j1 = pm.GetMatch(i); + + std::cout + << G.vertices[i].coordinate[0] << " " + << G.vertices[i].coordinate[1] << " " + << G.vertices[j1].coordinate[0] << " " + << G.vertices[j1].coordinate[1] << std::endl; + } + std::vector<bool> matching(G.edges.size()); for (unsigned i = 0; i < G.edges.size(); i++) { @@ -132,27 +144,15 @@ int main(int argc, char* argv[]) { pm.Solve(); - std::cout << n << std::endl; - - for (unsigned i = 0; i < G.vertices.size() / 2; i++) { - unsigned j1 = pm.GetMatch(i); - - std::cout - << G.vertices[i].coordinate[0] << " " - << G.vertices[i].coordinate[1] << " " - << G.vertices[j1].coordinate[0] << " " - << G.vertices[j1].coordinate[1] << std::endl; - } - unsigned m = 0; for (unsigned i = 0; i < G.edges.size(); i++) { - if (matching[i] && !edgeMatched(pm, G.edges[i])) { + if (!matching[i] && edgeMatched(pm, G.edges[i])) { m++; std::cout << G.edges[i].halfedges[0].getTail().coordinate[0] << " " - << G.edges[i].halfedges[0].getHead().coordinate[1] << " " - << G.edges[i].halfedges[1].getTail().coordinate[0] << " " - << G.edges[i].halfedges[1].getHead().coordinate[1] << std::endl; + << G.edges[i].halfedges[0].getTail().coordinate[1] << " " + << G.edges[i].halfedges[0].getHead().coordinate[0] << " " + << G.edges[i].halfedges[0].getHead().coordinate[1] << std::endl; } } |