summaryrefslogtreecommitdiff
path: root/order.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'order.cpp')
-rw-r--r--order.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/order.cpp b/order.cpp
index c2deb38..21335ad 100644
--- a/order.cpp
+++ b/order.cpp
@@ -1,4 +1,5 @@
#include <iostream>
+#include <fstream>
#include <random>
#include "rbmp.hpp"
@@ -32,6 +33,16 @@ int main(int argc, char* argv[]) {
std::vector<long int> data_x(G.vertices.size() / 2);
std::vector<long int> data_y(G.vertices.size() / 2);
+ std::string filename = "order_" + std::to_string(n) + ".dat";
+ std::ifstream input(filename);
+
+ for (unsigned i = 0; i < G.vertices.size() / 2; i++) {
+ input >> data_x[i];
+ input >> data_y[i];
+ }
+
+ input.close();
+
#pragma omp parallel for reduction(vec_int_plus : data_x) reduction(vec_int_plus : data_y)
for (unsigned i = 0; i < m; i++) {
PerfectMatching pm(G.vertices.size(), G.edges.size());
@@ -53,11 +64,13 @@ int main(int argc, char* argv[]) {
}
}
- std::cout << n << std::endl;
+ std::ofstream output(filename);
for (unsigned i = 0; i < G.vertices.size() / 2; i++) {
- std::cout << data_x[i] << " " << data_y[i] << std::endl;
+ output << data_x[i] << " " << data_y[i] << std::endl;
}
+ output.close();
+
return 0;
}