diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2022-10-04 16:17:29 +0200 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2022-10-04 16:17:29 +0200 |
commit | e55894853b0f254588f965fbf39b1e4cc132e7fe (patch) | |
tree | 8ae024a5bab652d4f1b0d932b17d59bc0fb17773 | |
parent | c6a8f62d7b8784ffdf27229fa711f990b5793c19 (diff) | |
download | code-e55894853b0f254588f965fbf39b1e4cc132e7fe.tar.gz code-e55894853b0f254588f965fbf39b1e4cc132e7fe.tar.bz2 code-e55894853b0f254588f965fbf39b1e4cc132e7fe.zip |
Output data to file that can be updated.
-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; } |