summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2022-09-30 12:37:50 +0200
committerJaron Kent-Dobias <jaron@kent-dobias.com>2022-09-30 12:37:50 +0200
commitaee1e277d32878055680f1a20708c171f17d3d3d (patch)
treef372a1c41e16eef71854fef00d76d060060950c0
parentcb93a79f7c422fcaa6f52cc361fff9e277fca04d (diff)
downloadcode-aee1e277d32878055680f1a20708c171f17d3d3d.tar.gz
code-aee1e277d32878055680f1a20708c171f17d3d3d.tar.bz2
code-aee1e277d32878055680f1a20708c171f17d3d3d.zip
Slightly changed what is output.
-rw-r--r--rbmp.cpp32
1 files 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<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;
}
}