Address PR comments

This commit is contained in:
Patrick Niklaus
2018-05-08 13:54:20 +00:00
committed by Patrick Niklaus
parent 2a15e6dec8
commit c459530cb6
6 changed files with 21 additions and 42 deletions
@@ -21,8 +21,8 @@ struct NodeBucket
{
NodeID middle_node;
NodeID parent_node;
bool from_clique_arc;
unsigned column_index; // a column in the weight/duration matrix
unsigned column_index : 31; // a column in the weight/duration matrix
unsigned from_clique_arc : 1;
EdgeWeight weight;
EdgeDuration duration;
@@ -32,8 +32,18 @@ struct NodeBucket
unsigned column_index,
EdgeWeight weight,
EdgeDuration duration)
: middle_node(middle_node), parent_node(parent_node), from_clique_arc(from_clique_arc),
column_index(column_index), weight(weight), duration(duration)
: middle_node(middle_node), parent_node(parent_node), column_index(column_index),
from_clique_arc(from_clique_arc), weight(weight), duration(duration)
{
}
NodeBucket(NodeID middle_node,
NodeID parent_node,
unsigned column_index,
EdgeWeight weight,
EdgeDuration duration)
: middle_node(middle_node), parent_node(parent_node), column_index(column_index),
from_clique_arc(false), weight(weight), duration(duration)
{
}
@@ -75,7 +85,7 @@ struct NodeBucket
}
};
};
}
} // namespace
template <typename Algorithm>
std::pair<std::vector<EdgeDuration>, std::vector<EdgeDistance>>
@@ -446,21 +446,6 @@ UnpackedPath search(SearchEngineData<Algorithm> &engine_working_data,
// Get packed path as edges {from node ID, to node ID, from_clique_arc}
auto packed_path = retrievePackedPathFromHeap(forward_heap, reverse_heap, middle);
// if (!packed_path.empty())
// {
// std::cout << "packed_path: ";
// for (auto edge : packed_path)
// {
// std::cout << std::get<0>(edge) << ",";
// }
// std::cout << std::get<1>(packed_path.back());
// std::cout << std::endl;
// }
// else
// {
// std::cout << "no packed_path!" << std::endl;
// }
// Beware the edge case when start, middle, end are all the same.
// In this case we return a single node, no edges. We also don't unpack.
const NodeID source_node = !packed_path.empty() ? std::get<0>(packed_path.front()) : middle;
@@ -520,12 +505,7 @@ UnpackedPath search(SearchEngineData<Algorithm> &engine_working_data,
unpacked_edges.insert(unpacked_edges.end(), subpath_edges.begin(), subpath_edges.end());
}
}
// std::cout << "unpacked_nodes: ";
// for (auto node : unpacked_nodes)
// {
// std::cout << node << ", ";
// }
// std::cout << std::endl;
return std::make_tuple(weight, std::move(unpacked_nodes), std::move(unpacked_edges));
}