From 5553dad42303e89fd702eac1bb33ef5f996d20b6 Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Mon, 28 Mar 2016 18:07:47 -0700 Subject: [PATCH] Fixes #2152 - weight vector needed to be reversed, and start index was wrong. --- include/engine/routing_algorithms/routing_base.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/engine/routing_algorithms/routing_base.hpp b/include/engine/routing_algorithms/routing_base.hpp index 1bebbf676..023ec7a67 100644 --- a/include/engine/routing_algorithms/routing_base.hpp +++ b/include/engine/routing_algorithms/routing_base.hpp @@ -360,7 +360,7 @@ template class BasicRoutingInterface if (target_traversed_in_reverse) { start_index = - id_vector.size() - phantom_node_pair.source_phantom.fwd_segment_position; + id_vector.size() - phantom_node_pair.source_phantom.fwd_segment_position - 1; } else { @@ -372,6 +372,7 @@ template class BasicRoutingInterface if (target_traversed_in_reverse) { std::reverse(id_vector.begin(), id_vector.end()); + std::reverse(weight_vector.begin(), weight_vector.end()); end_index = id_vector.size() - phantom_node_pair.target_phantom.fwd_segment_position; }