From 5c77bb7c677d089b98c584101e9157405558856d Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Wed, 17 Jun 2015 19:51:35 +0200 Subject: [PATCH] Fix inversion of sign --- routing_algorithms/alternative_path.hpp | 4 ++-- routing_algorithms/shortest_path.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/routing_algorithms/alternative_path.hpp b/routing_algorithms/alternative_path.hpp index 1dcc02096..327bb329f 100644 --- a/routing_algorithms/alternative_path.hpp +++ b/routing_algorithms/alternative_path.hpp @@ -103,8 +103,8 @@ class AlternativeRouting final int upper_bound_to_shortest_path_distance = INVALID_EDGE_WEIGHT; NodeID middle_node = SPECIAL_NODEID; const EdgeWeight min_edge_offset = - std::min(phantom_node_pair.source_phantom.GetForwardWeightPlusOffset(), - phantom_node_pair.source_phantom.GetReverseWeightPlusOffset()); + std::min(-phantom_node_pair.source_phantom.GetForwardWeightPlusOffset(), + -phantom_node_pair.source_phantom.GetReverseWeightPlusOffset()); if (phantom_node_pair.source_phantom.forward_node_id != SPECIAL_NODEID) { diff --git a/routing_algorithms/shortest_path.hpp b/routing_algorithms/shortest_path.hpp index 9e6b89045..eaa6d3c53 100644 --- a/routing_algorithms/shortest_path.hpp +++ b/routing_algorithms/shortest_path.hpp @@ -93,8 +93,8 @@ class ShortestPathRouting final const bool allow_u_turn = current_leg > 0 && uturn_indicators.size() > current_leg && uturn_indicators[current_leg - 1]; const EdgeWeight min_edge_offset = - std::min(phantom_node_pair.source_phantom.GetForwardWeightPlusOffset(), - phantom_node_pair.source_phantom.GetReverseWeightPlusOffset()); + std::min(-phantom_node_pair.source_phantom.GetForwardWeightPlusOffset(), + -phantom_node_pair.source_phantom.GetReverseWeightPlusOffset()); // insert new starting nodes into forward heap, adjusted by previous distances. if ((allow_u_turn || search_from_1st_node) &&