Skip to content
Snippets Groups Projects
Commit ebff7583 authored by p-hamann's avatar p-hamann
Browse files

IBFS: add sources and sinks as references

parent 82deb6b4
Branches
1 merge request!9Perf optimization
......@@ -10,7 +10,7 @@ ibfs_subtree::ibfs_subtree(int id, const graph& g, std::vector<unsigned int>& fl
flow_edges_(flow_edges) {
}
void ibfs_subtree::reset(std::vector<node_id> roots) {
void ibfs_subtree::reset(std::vector<node_id>& roots) {
for (unsigned int i = 0; i < labels_.size(); ++i) {
labels_[i] = unassigned_;
pred_[i] = 0;
......
......@@ -9,7 +9,7 @@ incremental_bfs::incremental_bfs(const graph& g)
node_assignments_ = std::vector<subtree>(g_.num_nodes());
}
void incremental_bfs::reset(std::vector<node_id> sources, std::vector<node_id> sinks) {
void incremental_bfs::reset(std::vector<node_id>& sources, std::vector<node_id>& sinks) {
assert(!sources.empty());
assert(!sinks.empty());
assert(sources.size() <= g_.num_nodes()/2+1);
......
......@@ -19,7 +19,7 @@ public:
/** @brief Resets the subtree with new roots
* @param List of new roots
*/
void reset(std::vector<node_id> roots);
void reset(std::vector<node_id>& roots);
/** @brief Deletes the path of the new flow of this subtree
* Part of the augmentation of this subtree
......
......@@ -17,7 +17,7 @@ public:
* @param List of new sources for S-T-cut
* @param List of new sinks for S-T-cut
*/
void reset(std::vector<node_id> sources, std::vector<node_id> sinks);
void reset(std::vector<node_id>& sources, std::vector<node_id>& sinks);
/** @brief Executes the IBFS algorithm
*/
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment