diff --git a/include/contractor/contractor_heap.hpp b/include/contractor/contractor_heap.hpp index 4aca16609..7f505bb8a 100644 --- a/include/contractor/contractor_heap.hpp +++ b/include/contractor/contractor_heap.hpp @@ -1,7 +1,7 @@ #ifndef OSRM_CONTRACTOR_CONTRACTOR_HEAP_HPP_ #define OSRM_CONTRACTOR_CONTRACTOR_HEAP_HPP_ -#include "util/binary_heap.hpp" +#include "util/query_heap.hpp" #include "util/typedefs.hpp" #include "util/xor_fast_hash_storage.hpp" @@ -18,11 +18,11 @@ struct ContractorHeapData bool target = false; }; -using ContractorHeap = util::BinaryHeap>; +using ContractorHeap = util::QueryHeap>; } // namespace contractor } // namespace osrm diff --git a/include/customizer/cell_customizer.hpp b/include/customizer/cell_customizer.hpp index ca40724dd..a9b1fd97a 100644 --- a/include/customizer/cell_customizer.hpp +++ b/include/customizer/cell_customizer.hpp @@ -3,7 +3,7 @@ #include "partition/cell_storage.hpp" #include "partition/multi_level_partition.hpp" -#include "util/binary_heap.hpp" +#include "util/query_heap.hpp" #include @@ -24,7 +24,7 @@ class CellCustomizer public: using Heap = - util::BinaryHeap>; + util::QueryHeap>; using HeapPtr = tbb::enumerable_thread_specific; CellCustomizer(const partition::MultiLevelPartition &partition) : partition(partition) {} diff --git a/include/engine/search_engine_data.hpp b/include/engine/search_engine_data.hpp index 34f7e06e9..0852d02c5 100644 --- a/include/engine/search_engine_data.hpp +++ b/include/engine/search_engine_data.hpp @@ -4,7 +4,7 @@ #include #include "engine/algorithm.hpp" -#include "util/binary_heap.hpp" +#include "util/query_heap.hpp" #include "util/typedefs.hpp" namespace osrm @@ -14,8 +14,7 @@ namespace engine // Algorithm-dependent heaps // - CH algorithms use CH heaps -// - CoreCH algorithms use CoreCH heaps that can be upcasted to CH heaps when CH algorithms reused -// by CoreCH at calling ch::routingStep, ch::retrievePackedPathFromSingleHeap and ch::unpackPath +// - CoreCH algorithms use CH // - MLD algorithms use MLD heaps template struct SearchEngineData @@ -37,14 +36,14 @@ struct ManyToManyHeapData : HeapData template <> struct SearchEngineData { using QueryHeap = util:: - BinaryHeap>; + QueryHeap>; using SearchEngineHeapPtr = boost::thread_specific_ptr; - using ManyToManyQueryHeap = util::BinaryHeap>; + using ManyToManyQueryHeap = util::QueryHeap>; using ManyToManyHeapPtr = boost::thread_specific_ptr; @@ -81,11 +80,11 @@ struct MultiLayerDijkstraHeapData template <> struct SearchEngineData { - using QueryHeap = util::BinaryHeap>; + using QueryHeap = util::QueryHeap>; using SearchEngineHeapPtr = boost::thread_specific_ptr; diff --git a/include/util/binary_heap.hpp b/include/util/query_heap.hpp similarity index 96% rename from include/util/binary_heap.hpp rename to include/util/query_heap.hpp index c7d3f962b..8f29ee6bb 100644 --- a/include/util/binary_heap.hpp +++ b/include/util/query_heap.hpp @@ -1,14 +1,12 @@ -#ifndef BINARY_HEAP_H -#define BINARY_HEAP_H +#ifndef OSRM_UTIL_QUERY_HEAP_HPP +#define OSRM_UTIL_QUERY_HEAP_HPP #include #include #include -#include #include #include -#include #include #include @@ -133,13 +131,13 @@ template > -class BinaryHeap +class QueryHeap { public: using WeightType = Weight; using DataType = Data; - explicit BinaryHeap(std::size_t maxID) : node_index(maxID) { Clear(); } + explicit QueryHeap(std::size_t maxID) : node_index(maxID) { Clear(); } void Clear() { @@ -256,4 +254,4 @@ class BinaryHeap } } -#endif // BINARY_HEAP_H +#endif // OSRM_UTIL_QUERY_HEAP_HPP diff --git a/src/engine/search_engine_data.cpp b/src/engine/search_engine_data.cpp index 63824493d..6b8bf5f44 100644 --- a/src/engine/search_engine_data.cpp +++ b/src/engine/search_engine_data.cpp @@ -1,7 +1,5 @@ #include "engine/search_engine_data.hpp" -#include "util/binary_heap.hpp" - namespace osrm { namespace engine diff --git a/unit_tests/util/binary_heap.cpp b/unit_tests/util/query_heap.cpp similarity index 91% rename from unit_tests/util/binary_heap.cpp rename to unit_tests/util/query_heap.cpp index ee60c8305..2e0f9f1a7 100644 --- a/unit_tests/util/binary_heap.cpp +++ b/unit_tests/util/query_heap.cpp @@ -1,4 +1,4 @@ -#include "util/binary_heap.hpp" +#include "util/query_heap.hpp" #include "util/typedefs.hpp" #include @@ -56,7 +56,7 @@ constexpr unsigned NUM_NODES = 100; BOOST_FIXTURE_TEST_CASE_TEMPLATE(insert_test, T, storage_types, RandomDataFixture) { - BinaryHeap heap(NUM_NODES); + QueryHeap heap(NUM_NODES); TestWeight min_weight = std::numeric_limits::max(); TestNodeID min_id; @@ -89,7 +89,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(insert_test, T, storage_types, RandomDataFixtur BOOST_FIXTURE_TEST_CASE_TEMPLATE(delete_min_test, T, storage_types, RandomDataFixture) { - BinaryHeap heap(NUM_NODES); + QueryHeap heap(NUM_NODES); for (unsigned idx : order) { @@ -111,7 +111,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(delete_min_test, T, storage_types, RandomDataFi BOOST_FIXTURE_TEST_CASE_TEMPLATE(delete_all_test, T, storage_types, RandomDataFixture) { - BinaryHeap heap(NUM_NODES); + QueryHeap heap(NUM_NODES); for (unsigned idx : order) { @@ -125,7 +125,7 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(delete_all_test, T, storage_types, RandomDataFi BOOST_FIXTURE_TEST_CASE_TEMPLATE(decrease_key_test, T, storage_types, RandomDataFixture<10>) { - BinaryHeap heap(10); + QueryHeap heap(10); for (unsigned idx : order) {