Generalize directShortestPathSearch interface

This commit is contained in:
Michael Krasnyk 2017-06-30 23:51:14 +02:00 committed by Patrick Niklaus
parent 3534203083
commit aa736dbe3a
2 changed files with 14 additions and 32 deletions

View File

@ -21,20 +21,11 @@ namespace routing_algorithms
/// by the previous route. /// by the previous route.
/// This variation is only an optimazation for graphs with slow queries, for example /// This variation is only an optimazation for graphs with slow queries, for example
/// not fully contracted graphs. /// not fully contracted graphs.
InternalRouteResult directShortestPathSearch( template <typename Algorithm>
SearchEngineData<ch::Algorithm> &engine_working_data, InternalRouteResult
const datafacade::ContiguousInternalMemoryDataFacade<ch::Algorithm> &facade, directShortestPathSearch(SearchEngineData<Algorithm> &engine_working_data,
const PhantomNodes &phantom_nodes); const datafacade::ContiguousInternalMemoryDataFacade<Algorithm> &facade,
const PhantomNodes &phantom_nodes);
InternalRouteResult directShortestPathSearch(
SearchEngineData<corech::Algorithm> &engine_working_data,
const datafacade::ContiguousInternalMemoryDataFacade<corech::Algorithm> &facade,
const PhantomNodes &phantom_nodes);
InternalRouteResult directShortestPathSearch(
SearchEngineData<mld::Algorithm> &engine_working_data,
const datafacade::ContiguousInternalMemoryDataFacade<mld::Algorithm> &facade,
const PhantomNodes &phantom_nodes);
} // namespace routing_algorithms } // namespace routing_algorithms
} // namespace engine } // namespace engine

View File

@ -44,8 +44,6 @@ extractRoute(const datafacade::ContiguousInternalMemoryDataFacade<AlgorithmT> &f
return raw_route_data; return raw_route_data;
} }
namespace detail
{
/// This is a striped down version of the general shortest path algorithm. /// This is a striped down version of the general shortest path algorithm.
/// The general algorithm always computes two queries for each leg. This is only /// The general algorithm always computes two queries for each leg. This is only
/// necessary in case of vias, where the directions of the start node is constrainted /// necessary in case of vias, where the directions of the start node is constrainted
@ -53,10 +51,10 @@ namespace detail
/// This variation is only an optimazation for graphs with slow queries, for example /// This variation is only an optimazation for graphs with slow queries, for example
/// not fully contracted graphs. /// not fully contracted graphs.
template <typename Algorithm> template <typename Algorithm>
InternalRouteResult directShortestPathSearchImpl( InternalRouteResult
SearchEngineData<Algorithm> &engine_working_data, directShortestPathSearch(SearchEngineData<Algorithm> &engine_working_data,
const datafacade::ContiguousInternalMemoryDataFacade<Algorithm> &facade, const datafacade::ContiguousInternalMemoryDataFacade<Algorithm> &facade,
const PhantomNodes &phantom_nodes) const PhantomNodes &phantom_nodes)
{ {
engine_working_data.InitializeOrClearFirstThreadLocalStorage(facade.GetNumberOfNodes()); engine_working_data.InitializeOrClearFirstThreadLocalStorage(facade.GetNumberOfNodes());
auto &forward_heap = *engine_working_data.forward_heap_1; auto &forward_heap = *engine_working_data.forward_heap_1;
@ -100,24 +98,17 @@ InternalRouteResult directShortestPathSearchImpl(
return extractRoute(facade, weight, phantom_nodes, unpacked_nodes, unpacked_edges); return extractRoute(facade, weight, phantom_nodes, unpacked_nodes, unpacked_edges);
} }
} // namespace ch template InternalRouteResult directShortestPathSearch(
InternalRouteResult directShortestPathSearch(
SearchEngineData<corech::Algorithm> &engine_working_data, SearchEngineData<corech::Algorithm> &engine_working_data,
const datafacade::ContiguousInternalMemoryDataFacade<corech::Algorithm> &facade, const datafacade::ContiguousInternalMemoryDataFacade<corech::Algorithm> &facade,
const PhantomNodes &phantom_nodes) const PhantomNodes &phantom_nodes);
{
return detail::directShortestPathSearchImpl(engine_working_data, facade, phantom_nodes);
}
InternalRouteResult directShortestPathSearch( template InternalRouteResult directShortestPathSearch(
SearchEngineData<ch::Algorithm> &engine_working_data, SearchEngineData<ch::Algorithm> &engine_working_data,
const datafacade::ContiguousInternalMemoryDataFacade<ch::Algorithm> &facade, const datafacade::ContiguousInternalMemoryDataFacade<ch::Algorithm> &facade,
const PhantomNodes &phantom_nodes) const PhantomNodes &phantom_nodes);
{
return detail::directShortestPathSearchImpl(engine_working_data, facade, phantom_nodes);
}
template <>
InternalRouteResult directShortestPathSearch( InternalRouteResult directShortestPathSearch(
SearchEngineData<mld::Algorithm> &engine_working_data, SearchEngineData<mld::Algorithm> &engine_working_data,
const datafacade::ContiguousInternalMemoryDataFacade<mld::Algorithm> &facade, const datafacade::ContiguousInternalMemoryDataFacade<mld::Algorithm> &facade,