From b3ba9fcfaa3a71897bd0490b30988e6d5eb1a082 Mon Sep 17 00:00:00 2001 From: Stefan Pranger Date: Mon, 24 Jan 2022 20:16:09 +0100 Subject: [PATCH] removed unnecessary code --- Graph.cpp | 14 +------------- Graph.h | 1 - 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/Graph.cpp b/Graph.cpp index f861ed1..277ebcf 100644 --- a/Graph.cpp +++ b/Graph.cpp @@ -10,16 +10,10 @@ namespace data { Graph::Graph(bool stdout_output, bool file_output, std::string output_filename, bool verbose_max_flow, bool min_cut, int verbosity) : m_file_output(file_output), m_output_file_name(output_filename), m_verbose_max_flow(verbose_max_flow), m_min_cut(min_cut), m_verbosity(verbosity) { - //if(!stdout_output && file_output) { - // m_stdout_output = false; - //} else { - // m_stdout_output = true; - //} } void Graph::parseFromString(const std::string &graph_string) { parser::parseString(graph_string, m_arc_list, m_vertices, m_source_id, m_sink_id, m_num_vertices, m_num_arcs); - setSourceAndSinkIterator(); initMatrices(); initOstream(); } @@ -29,7 +23,6 @@ namespace data { throw std::runtime_error("Input graph file name and output file name are the same. Will not overwrite. Exiting..."); } parser::parseFile(graph_file, m_arc_list, m_vertices, m_source_id, m_sink_id, m_num_vertices, m_num_arcs); - setSourceAndSinkIterator(); initMatrices(); initOstream(); } @@ -38,15 +31,10 @@ namespace data { m_flow.resize(m_num_vertices, std::vector(m_num_vertices, 0)); m_capapcities.resize(m_num_vertices, std::vector(m_num_vertices, 0)); for(auto const &arc : m_arc_list) { - m_capapcities.at(arc.start - 1).at(arc.end - 1) = arc.capacity; // how to best map arbitrary ids to index in matrix + m_capapcities.at(arc.start - 1).at(arc.end - 1) = arc.capacity; } } - void Graph::setSourceAndSinkIterator() { - auto m_source = std::find_if(m_vertices.begin(), m_vertices.end(), [this] (const Vertex &v) { return (v.getID() == m_source_id); }); - auto m_sink = std::find_if(m_vertices.begin(), m_vertices.end(), [this] (const Vertex &v) { return (v.getID() == m_sink_id); }); - } - void Graph::initOstream() { if(m_file_output) { m_ofstream = new std::ofstream(m_output_file_name); diff --git a/Graph.h b/Graph.h index 1b7d734..e55e168 100644 --- a/Graph.h +++ b/Graph.h @@ -26,7 +26,6 @@ namespace data { private: void initMatrices(); - void setSourceAndSinkIterator(); void initOstream(); void constructLevelGraph();