From e55894853b0f254588f965fbf39b1e4cc132e7fe Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 4 Oct 2022 16:17:29 +0200 Subject: Output data to file that can be updated. --- order.cpp | 17 +++++++++++++++-- 1 file 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 +#include #include #include "rbmp.hpp" @@ -32,6 +33,16 @@ int main(int argc, char* argv[]) { std::vector data_x(G.vertices.size() / 2); std::vector 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; } -- cgit v1.2.3-70-g09d2