diff --git a/cucumber.js b/cucumber.js index 101bf8e95..b01b3404a 100644 --- a/cucumber.js +++ b/cucumber.js @@ -3,5 +3,5 @@ module.exports = { verify: '--strict --tags ~@stress --tags ~@todo -f progress --require features/support --require features/step_definitions', todo: '--strict --tags @todo --require features/support --require features/step_definitions', all: '--strict --require features/support --require features/step_definitions', - mld: '--strict --tags ~@stress --tags ~@todo --tags ~@alternative --tags ~@matrix --tags ~@trip --require features/support --require features/step_definitions -f progress' + mld: '--strict --tags ~@stress --tags ~@todo --tags ~@alternative --require features/support --require features/step_definitions -f progress' } diff --git a/include/engine/algorithm.hpp b/include/engine/algorithm.hpp index 78db41ebc..b7a2f47e6 100644 --- a/include/engine/algorithm.hpp +++ b/include/engine/algorithm.hpp @@ -102,6 +102,9 @@ template <> struct HasShortestPathSearch final : std::true_type template <> struct HasMapMatching final : std::true_type { }; +template <> struct HasManyToManySearch final : std::true_type +{ +}; template <> struct HasGetTileTurns final : std::true_type { }; diff --git a/include/engine/api/table_api.hpp b/include/engine/api/table_api.hpp index e4932feea..2ff667404 100644 --- a/include/engine/api/table_api.hpp +++ b/include/engine/api/table_api.hpp @@ -42,7 +42,6 @@ class TableAPI final : public BaseAPI { auto number_of_sources = parameters.sources.size(); auto number_of_destinations = parameters.destinations.size(); - ; // symmetric case if (parameters.sources.empty()) diff --git a/include/engine/routing_algorithms.hpp b/include/engine/routing_algorithms.hpp index 20ae27a34..da7a216b0 100644 --- a/include/engine/routing_algorithms.hpp +++ b/include/engine/routing_algorithms.hpp @@ -157,8 +157,7 @@ RoutingAlgorithms::ManyToManySearch(const std::vector &p const std::vector &source_indices, const std::vector &target_indices) const { - return routing_algorithms::ch::manyToManySearch( - heaps, facade, phantom_nodes, source_indices, target_indices); + return manyToManySearch(heaps, facade, phantom_nodes, source_indices, target_indices); } template @@ -211,16 +210,6 @@ InternalManyRoutesResult inline RoutingAlgorithms< { throw util::exception("AlternativePathSearch is not implemented"); } - -template <> -inline std::vector -RoutingAlgorithms::ManyToManySearch( - const std::vector &, - const std::vector &, - const std::vector &) const -{ - throw util::exception("ManyToManySearch is not implemented"); -} } } diff --git a/include/engine/routing_algorithms/many_to_many.hpp b/include/engine/routing_algorithms/many_to_many.hpp index 338cf4a88..f036ecf99 100644 --- a/include/engine/routing_algorithms/many_to_many.hpp +++ b/include/engine/routing_algorithms/many_to_many.hpp @@ -26,6 +26,16 @@ manyToManySearch(SearchEngineData &engine_working_data, const std::vector &target_indices); } // namespace ch +namespace mld +{ +std::vector +manyToManySearch(SearchEngineData &engine_working_data, + const datafacade::ContiguousInternalMemoryDataFacade &facade, + const std::vector &phantom_nodes, + const std::vector &source_indices, + const std::vector &target_indices); +} // namespace mld + } // namespace routing_algorithms } // namespace engine } // namespace osrm diff --git a/src/engine/routing_algorithms/many_to_many.cpp b/src/engine/routing_algorithms/many_to_many.cpp index 674988cf1..b3fcd8187 100644 --- a/src/engine/routing_algorithms/many_to_many.cpp +++ b/src/engine/routing_algorithms/many_to_many.cpp @@ -243,6 +243,31 @@ manyToManySearch(SearchEngineData &engine_working_data, } } // namespace ch + +// TODO: generalize with CH version +namespace mld +{ +std::vector +manyToManySearch(SearchEngineData &engine_working_data, + const datafacade::ContiguousInternalMemoryDataFacade &facade, + const std::vector &phantom_nodes, + const std::vector &source_indices, + const std::vector &target_indices) +{ + const auto number_of_sources = + source_indices.empty() ? phantom_nodes.size() : source_indices.size(); + const auto number_of_targets = + target_indices.empty() ? phantom_nodes.size() : target_indices.size(); + const auto number_of_entries = number_of_sources * number_of_targets; + + std::vector weights_table(number_of_entries, INVALID_EDGE_WEIGHT); + std::vector durations_table(number_of_entries, MAXIMAL_EDGE_DURATION); + + return durations_table; +} + +} // namespace mld + } // namespace routing_algorithms } // namespace engine } // namespace osrm