21#ifndef GCC_SHORTEST_PATHS_H
22#define GCC_SHORTEST_PATHS_H
47template <
typename GraphTraits,
typename Path_t>
51 typedef typename GraphTraits::graph_t
graph_t;
52 typedef typename GraphTraits::node_t
node_t;
53 typedef typename GraphTraits::edge_t
edge_t;
87template <
typename GraphTraits,
typename Path_t>
95 m_dist (
graph.m_nodes.length ()),
96 m_best_edge (
graph.m_nodes.length ())
102 for (
unsigned i = 0;
i <
graph.m_nodes.length ();
i++)
110 while (
queue.length () > 0)
117 for (
unsigned i = 0;
i <
queue.length ();
i++)
145 node_t *dest = succ->m_dest;
161 node_t *src = pred->m_src;
181template <
typename GraphTraits,
typename Path_t>
190 result.m_edges.safe_push (m_best_edge[
other_node->m_index]);
198 result.m_edges.reverse ();
207template <
typename GraphTraits,
typename Path_t>
Definition shortest-paths.h:49
GraphTraits::graph_t graph_t
Definition shortest-paths.h:51
GraphTraits::node_t node_t
Definition shortest-paths.h:52
auto_vec< const edge_t * > m_best_edge
Definition shortest-paths.h:76
Path_t path_t
Definition shortest-paths.h:54
enum shortest_path_sense m_sense
Definition shortest-paths.h:65
shortest_paths(const graph_t &graph, const node_t *given_node, enum shortest_path_sense sense)
Definition shortest-paths.h:90
const graph_t & m_graph
Definition shortest-paths.h:63
int get_shortest_distance(const node_t *other_node) const
Definition shortest-paths.h:210
GraphTraits::edge_t edge_t
Definition shortest-paths.h:53
auto_vec< int > m_dist
Definition shortest-paths.h:69
path_t get_shortest_path(const node_t *other_node) const
Definition shortest-paths.h:184
T * ggc_alloc(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:184
#define INT_MAX
Definition glimits.h:85
static vec< tree, va_gc > * queue
Definition godump.cc:57
i
Definition poly-int.h:772
shortest_path_sense
Definition shortest-paths.h:27
@ SPS_TO_GIVEN_TARGET
Definition shortest-paths.h:34
@ SPS_FROM_GIVEN_ORIGIN
Definition shortest-paths.h:30
#define NULL
Definition system.h:50
#define gcc_assert(EXPR)
Definition system.h:821
#define FOR_EACH_VEC_ELT(V, I, P)
Definition vec.h:1884