Rename BinaryHeap to QueryHeap

This commit is contained in:
Michael Krasnyk
2017-05-02 13:12:28 +02:00
committed by Patrick Niklaus
parent 358aebec4d
commit 07c7cb3c6c
6 changed files with 31 additions and 36 deletions
+6 -6
View File
@@ -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<NodeID,
NodeID,
EdgeWeight,
ContractorHeapData,
util::XORFastHashStorage<NodeID, NodeID>>;
using ContractorHeap = util::QueryHeap<NodeID,
NodeID,
EdgeWeight,
ContractorHeapData,
util::XORFastHashStorage<NodeID, NodeID>>;
} // namespace contractor
} // namespace osrm
+2 -2
View File
@@ -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 <tbb/enumerable_thread_specific.h>
@@ -24,7 +24,7 @@ class CellCustomizer
public:
using Heap =
util::BinaryHeap<NodeID, NodeID, EdgeWeight, HeapData, util::ArrayStorage<NodeID, int>>;
util::QueryHeap<NodeID, NodeID, EdgeWeight, HeapData, util::ArrayStorage<NodeID, int>>;
using HeapPtr = tbb::enumerable_thread_specific<Heap>;
CellCustomizer(const partition::MultiLevelPartition &partition) : partition(partition) {}
+13 -14
View File
@@ -4,7 +4,7 @@
#include <boost/thread/tss.hpp>
#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 <typename Algorithm> struct SearchEngineData
@@ -37,14 +36,14 @@ struct ManyToManyHeapData : HeapData
template <> struct SearchEngineData<routing_algorithms::ch::Algorithm>
{
using QueryHeap = util::
BinaryHeap<NodeID, NodeID, EdgeWeight, HeapData, util::UnorderedMapStorage<NodeID, int>>;
QueryHeap<NodeID, NodeID, EdgeWeight, HeapData, util::UnorderedMapStorage<NodeID, int>>;
using SearchEngineHeapPtr = boost::thread_specific_ptr<QueryHeap>;
using ManyToManyQueryHeap = util::BinaryHeap<NodeID,
NodeID,
EdgeWeight,
ManyToManyHeapData,
util::UnorderedMapStorage<NodeID, int>>;
using ManyToManyQueryHeap = util::QueryHeap<NodeID,
NodeID,
EdgeWeight,
ManyToManyHeapData,
util::UnorderedMapStorage<NodeID, int>>;
using ManyToManyHeapPtr = boost::thread_specific_ptr<ManyToManyQueryHeap>;
@@ -81,11 +80,11 @@ struct MultiLayerDijkstraHeapData
template <> struct SearchEngineData<routing_algorithms::mld::Algorithm>
{
using QueryHeap = util::BinaryHeap<NodeID,
NodeID,
EdgeWeight,
MultiLayerDijkstraHeapData,
util::UnorderedMapStorage<NodeID, int>>;
using QueryHeap = util::QueryHeap<NodeID,
NodeID,
EdgeWeight,
MultiLayerDijkstraHeapData,
util::UnorderedMapStorage<NodeID, int>>;
using SearchEngineHeapPtr = boost::thread_specific_ptr<QueryHeap>;
@@ -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 <boost/assert.hpp>
#include <boost/heap/d_ary_heap.hpp>
#include <algorithm>
#include <cstddef>
#include <limits>
#include <map>
#include <type_traits>
#include <unordered_map>
#include <vector>
@@ -133,13 +131,13 @@ template <typename NodeID,
typename Weight,
typename Data,
typename IndexStorage = ArrayStorage<NodeID, NodeID>>
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