From aee1e277d32878055680f1a20708c171f17d3d3d Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 30 Sep 2022 12:37:50 +0200 Subject: Slightly changed what is output. --- rbmp.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/rbmp.cpp b/rbmp.cpp index 84ed351..e677a11 100644 --- a/rbmp.cpp +++ b/rbmp.cpp @@ -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 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; } } -- cgit v1.2.3-54-g00ecf