Skip to content

Commit

Permalink
use constexpr if
Browse files Browse the repository at this point in the history
  • Loading branch information
SiarheiFedartsou committed May 21, 2024
1 parent cd21789 commit 408c72d
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions include/engine/routing_algorithms/routing_base_mld.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ retrievePackedPathFromHeap(const SearchEngineData<Algorithm>::QueryHeap &forward
return packed_path;
}

template <bool DIRECTION, typename Algorithm, typename Heap, typename... Args>
void relaxOutgoingEdges(const DataFacade<Algorithm> &facade,
template <bool DIRECTION, typename Heap, typename... Args>
void relaxOutgoingEdges(const DataFacade<mld::Algorithm> &facade,
Heap &forward_heap,
const typename Heap::HeapNode &heapNode,
const Args &...args)
Expand Down Expand Up @@ -451,8 +451,8 @@ void relaxOutgoingEdges(const DataFacade<Algorithm> &facade,
}
}

template <bool DIRECTION, typename Algorithm, typename Heap, typename... Args>
void routingStep(const DataFacade<Algorithm> &facade,
template <bool DIRECTION, typename Heap, typename... Args>
void routingStep(const DataFacade<mld::Algorithm> &facade,
Heap &forward_heap,
Heap &reverse_heap,
NodeID &middle_node,
Expand Down Expand Up @@ -497,11 +497,11 @@ using UnpackedNodes = std::vector<NodeID>;
using UnpackedEdges = std::vector<EdgeID>;
using UnpackedPath = std::tuple<EdgeWeight, UnpackedNodes, UnpackedEdges>;

template <typename Algorithm, typename... Args>
UnpackedPath search(SearchEngineData<Algorithm> &engine_working_data,
const DataFacade<Algorithm> &facade,
typename SearchEngineData<Algorithm>::QueryHeap &forward_heap,
typename SearchEngineData<Algorithm>::QueryHeap &reverse_heap,
template <typename... Args>
UnpackedPath search(SearchEngineData<mld::Algorithm> &engine_working_data,
const DataFacade<mld::Algorithm> &facade,
typename SearchEngineData<mld::Algorithm>::QueryHeap &forward_heap,
typename SearchEngineData<mld::Algorithm>::QueryHeap &reverse_heap,
const std::vector<NodeID> &force_step_nodes,
EdgeWeight weight_upper_bound,
const Args &...args)
Expand Down Expand Up @@ -607,10 +607,10 @@ UnpackedPath search(SearchEngineData<Algorithm> &engine_working_data,
return std::make_tuple(weight, std::move(unpacked_nodes), std::move(unpacked_edges));
}

template <typename Algorithm, typename... Args>
template <typename... Args>
EdgeDistance
searchDistance(SearchEngineData<Algorithm> &,
const DataFacade<Algorithm> &facade,
searchDistance(SearchEngineData<mld::Algorithm> &,
const DataFacade<mld::Algorithm> &facade,
typename SearchEngineData<Algorithm>::MapMatchingQueryHeap &forward_heap,
typename SearchEngineData<Algorithm>::MapMatchingQueryHeap &reverse_heap,
const std::vector<NodeID> &force_step_nodes,
Expand Down Expand Up @@ -663,9 +663,9 @@ searchDistance(SearchEngineData<Algorithm> &,
}

// Alias to be compatible with the CH-based search
template <typename Algorithm, typename PhantomEndpointT>
inline void search(SearchEngineData<Algorithm> &engine_working_data,
const DataFacade<Algorithm> &facade,
template <typename PhantomEndpointT>
inline void search(SearchEngineData<mld::Algorithm> &engine_working_data,
const DataFacade<mld::Algorithm> &facade,
typename SearchEngineData<Algorithm>::QueryHeap &forward_heap,
typename SearchEngineData<Algorithm>::QueryHeap &reverse_heap,
EdgeWeight &weight,
Expand Down Expand Up @@ -716,9 +716,8 @@ void unpackPath(const FacadeT &facade,
annotatePath(facade, route_endpoints, unpacked_nodes, unpacked_edges, unpacked_path);
}

template <typename Algorithm>
double getNetworkDistance(SearchEngineData<Algorithm> &engine_working_data,
const DataFacade<Algorithm> &facade,
inline double getNetworkDistance(SearchEngineData<mld::Algorithm> &engine_working_data,
const DataFacade<mld::Algorithm> &facade,
typename SearchEngineData<Algorithm>::MapMatchingQueryHeap &forward_heap,
typename SearchEngineData<Algorithm>::MapMatchingQueryHeap &reverse_heap,
const PhantomNode &source_phantom,
Expand Down

0 comments on commit 408c72d

Please sign in to comment.