19 template<
typename TNode>
26 template<
typename TNode>
31 const TNode &intersection_node);
35 template<
typename TNode,
typename TWeight>
45 template<
typename TNode,
typename TWeight>
54 const TNode &intersection_node);
58 template<
typename TNode>
67template<
typename TNode>
74 if (p.find(goal) == p.
end()) {
79 TNode current_vertex = goal;
81 while (current_vertex !=
start) {
82 current_vertex = p.
at(current_vertex);
83 path.push_back(current_vertex);
87 std::reverse(path.
begin(), path.
end());
92template<
typename TNode>
97 const TNode &intersection_node) {
101 if (p_forward.find(intersection_node) == p_forward.
end()
102 || p_backward.find(intersection_node) == p_backward.
end()) {
107 path.push_back(intersection_node);
108 TNode current_vertex = intersection_node;
110 while (current_vertex !=
start) {
111 current_vertex = p_forward.
at(current_vertex);
112 path.push_back(current_vertex);
115 std::reverse(path.
begin(), path.
end());
118 current_vertex = intersection_node;
119 while (current_vertex != goal) {
120 current_vertex = p_backward.
at(current_vertex);
121 path.push_back(current_vertex);
130template<
typename TNode,
typename TWeight>
136 if (g.find(goal) == g.
end()) {
143template<
typename TNode,
typename TWeight>
151 const TNode &intersection_node) {
152 if (g_forward.find(intersection_node) == g_forward.
end() || g_backward.find(intersection_node) == g_backward.
end()) {
157 g_forward.
at(intersection_node) + g_backward.
at(intersection_node));
162template<
typename TNode>
166 forward_path.
insert(forward_path.
end(), ++backward_path.rbegin(), backward_path.rend());
Class extending the map class from the standard library. Original reason is to allow printing of the ...
Definition: map.hpp:48
R & at(const T &key, R &defaultValue)
Definition: map.hpp:163
auto end() &
Inherited behavior of end for non-const instance.
Definition: map.hpp:215
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
auto begin() &
Inherited behavior of begin for non-const instance.
Definition: vector.hpp:125
reverse_iterator insert(const_reverse_iterator pos, const T &value)
Inserts the value on position given by iterator pos.
Definition: vector.hpp:229
auto end() &
Inherited behavior of end for non-const instance.
Definition: vector.hpp:155
Definition: ReconstructPath.hpp:16
static ext::vector< TNode > joinPath(ext::vector< TNode > &forward_path, const ext::vector< TNode > &backward_path)
Definition: ReconstructPath.hpp:163
static ext::pair< ext::vector< TNode >, TWeight > reconstructWeightedPath(const ext::map< TNode, TNode > &p, const ext::map< TNode, TWeight > &g, const TNode &start, const TNode &goal)
Definition: ReconstructPath.hpp:132
static ext::vector< TNode > reconstructPath(const ext::map< TNode, TNode > &p, const TNode &start, const TNode &goal)
Definition: ReconstructPath.hpp:68
constexpr const T & max(const T &a)
Root case of maximum computation. The maximum from one value is the value itself.
Definition: algorithm.hpp:278
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79
Definition: ReconstructPath.hpp:14
void start(measurements::stealth_string name, measurements::Type type)
Definition: measurements.cpp:14