Refactor contract to be a stateless function

This commit is contained in:
Patrick Niklaus
2017-08-19 22:01:35 +00:00
committed by Patrick Niklaus
parent 421dc5b6ec
commit e23dc8977f
3 changed files with 591 additions and 627 deletions
+3 -5
View File
@@ -73,14 +73,12 @@ int Contractor::Run()
util::DeallocatingVector<QueryEdge> contracted_edge_list;
{ // own scope to not keep the contractor around
auto contractor_graph = toContractorGraph(max_edge_id+1, std::move(edge_based_edge_list));
GraphContractor graph_contractor(contractor_graph,
std::tie(node_levels, is_core_node) = contractGraph(contractor_graph,
std::move(node_levels),
std::move(node_weights));
graph_contractor.Run(config.core_factor);
std::move(node_weights),
config.core_factor);
contracted_edge_list = toEdges<QueryEdge>(std::move(contractor_graph));
is_core_node = graph_contractor.GetCoreMarker();
node_levels = graph_contractor.GetNodeLevels();
}
TIMER_STOP(contraction);