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

Validate input vectors

parent a54d40f2
No related merge requests found
......@@ -6,6 +6,11 @@
incremental_bfs::incremental_bfs(const graph& g, std::vector<node_id> sources, std::vector<node_id> sinks)
: g_(g), sources_(sources), sinks_(sinks), s_(ibfs_subtree(sources, subtree::s, g)), t_(ibfs_subtree(sinks, subtree::t, g)) {
assert(!sources.empty());
assert(!sinks.empty());
assert(sources.size() <= g.num_nodes()/2);
assert(sinks.size() <= g.num_nodes()/2);
node_assignments_ = std::vector<subtree>(g.num_nodes(), none);
for (node_id node : sources) {
node_assignments_[node-1] = s;
......
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