diff options
-rw-r--r-- | order.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -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; } |