Skip to content

Commit 75d5881

Browse files
author
xin.wang
committed
formatting change for CI to proceed
1 parent 6e1e8f9 commit 75d5881

File tree

2 files changed

+32
-17
lines changed

2 files changed

+32
-17
lines changed

src/contractor/contractor_search.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ void relaxNode(ContractorHeap &heap,
3535
// New Node discovered -> Add to Heap + Node Info Storage
3636
if (!toHeapNode)
3737
{
38-
if (!contractable[to]) {
38+
if (!contractable[to])
39+
{
3940
continue;
4041
}
4142
heap.Insert(to, to_weight, ContractorHeapData{current_hop, false});

src/contractor/graph_contractor.cpp

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,24 @@ void ContractNode(ContractorThreadData *data,
246246
if (RUNSIMULATION)
247247
{
248248
const int constexpr SIMULATION_SEARCH_SPACE_SIZE = 1000;
249-
search(heap, graph, contractable, number_of_targets, SIMULATION_SEARCH_SPACE_SIZE, max_weight, node);
249+
search(heap,
250+
graph,
251+
contractable,
252+
number_of_targets,
253+
SIMULATION_SEARCH_SPACE_SIZE,
254+
max_weight,
255+
node);
250256
}
251257
else
252258
{
253259
const int constexpr FULL_SEARCH_SPACE_SIZE = 2000;
254-
search(heap, graph, contractable, number_of_targets, FULL_SEARCH_SPACE_SIZE, max_weight, node);
260+
search(heap,
261+
graph,
262+
contractable,
263+
number_of_targets,
264+
FULL_SEARCH_SPACE_SIZE,
265+
max_weight,
266+
node);
255267
}
256268
for (auto out_edge : graph.GetAdjacentEdgeRange(node))
257269
{
@@ -490,7 +502,8 @@ bool UpdateNodeNeighbours(ContractorNodeData &node_data,
490502
if (node_data.contractable[u])
491503
{
492504
node_data.priorities[u] = EvaluateNodePriority(
493-
SimulateNodeContraction(data, graph, u, node_data.weights, node_data.contractable), node_data.depths[u]);
505+
SimulateNodeContraction(data, graph, u, node_data.weights, node_data.contractable),
506+
node_data.depths[u]);
494507
}
495508
}
496509
return true;
@@ -621,19 +634,20 @@ std::vector<bool> contractGraph(ContractorGraph &graph,
621634
{
622635
util::UnbufferedLog log;
623636
log << "initializing node priorities...";
624-
tbb::parallel_for(tbb::blocked_range<std::size_t>(0, remaining_nodes.size(), PQGrainSize),
625-
[&](const auto &range)
626-
{
627-
ContractorThreadData *data = thread_data_list.GetThreadData();
628-
for (auto x = range.begin(), end = range.end(); x != end; ++x)
629-
{
630-
auto node = remaining_nodes[x].id;
631-
BOOST_ASSERT(node_data.contractable[node]);
632-
node_data.priorities[node] = EvaluateNodePriority(
633-
SimulateNodeContraction(data, graph, node, node_data.weights, node_data.contractable),
634-
node_data.depths[node]);
635-
}
636-
});
637+
tbb::parallel_for(
638+
tbb::blocked_range<std::size_t>(0, remaining_nodes.size(), PQGrainSize),
639+
[&](const auto &range)
640+
{
641+
ContractorThreadData *data = thread_data_list.GetThreadData();
642+
for (auto x = range.begin(), end = range.end(); x != end; ++x)
643+
{
644+
auto node = remaining_nodes[x].id;
645+
BOOST_ASSERT(node_data.contractable[node]);
646+
node_data.priorities[node] = EvaluateNodePriority(
647+
SimulateNodeContraction(data, graph, node, node_data.weights, node_data.contractable),
648+
node_data.depths[node]);
649+
}
650+
});
637651
log << " ok.";
638652
}
639653

0 commit comments

Comments
 (0)