diff --git a/include/customizer/cell_customizer.hpp b/include/customizer/cell_customizer.hpp index 548f315a9..ca40724dd 100644 --- a/include/customizer/cell_customizer.hpp +++ b/include/customizer/cell_customizer.hpp @@ -23,14 +23,15 @@ class CellCustomizer }; public: - using Heap = util:: - BinaryHeap>; + using Heap = + util::BinaryHeap>; using HeapPtr = tbb::enumerable_thread_specific; CellCustomizer(const partition::MultiLevelPartition &partition) : partition(partition) {} template - void Customize(const GraphT &graph, Heap& heap, partition::CellStorage &cells, LevelID level, CellID id) + void Customize( + const GraphT &graph, Heap &heap, partition::CellStorage &cells, LevelID level, CellID id) { auto cell = cells.GetCell(level, id); auto destinations = cell.GetDestinationNodes(); @@ -77,7 +78,7 @@ class CellCustomizer { tbb::parallel_for(tbb::blocked_range(0, partition.GetNumberOfCells(level)), [&](const tbb::blocked_range &range) { - auto& heap = heaps.local(); + auto &heap = heaps.local(); for (auto id = range.begin(), end = range.end(); id != end; ++id) { Customize(graph, heap, cells, level, id); @@ -87,7 +88,6 @@ class CellCustomizer } private: - template void RelaxNode(const GraphT &graph, const partition::CellStorage &cells, diff --git a/include/util/binary_heap.hpp b/include/util/binary_heap.hpp index 3d88a9138..59c301d70 100644 --- a/include/util/binary_heap.hpp +++ b/include/util/binary_heap.hpp @@ -19,15 +19,21 @@ namespace util template class GenerationArrayStorage { using GenerationCounter = std::uint16_t; - public: - explicit GenerationArrayStorage(std::size_t size) : positions(size, 0), generation(1), generations(size, 0) {} - Key &operator[](NodeID node) { + public: + explicit GenerationArrayStorage(std::size_t size) + : positions(size, 0), generation(1), generations(size, 0) + { + } + + Key &operator[](NodeID node) + { generation[node] = generation; return positions[node]; } - Key peek_index(const NodeID node) const { + Key peek_index(const NodeID node) const + { if (generations[node] < generation) { return std::numeric_limits::max(); @@ -35,7 +41,8 @@ template class GenerationArrayStorage return positions[node]; } - void Clear() { + void Clear() + { generation++; // if generation overflows we end up at 0 again and need to clear the vector if (generation == 0)