MCPcopy Create free account
hub / github.com/ElementsProject/lightning / node_adjacency_begin

Function node_adjacency_begin

plugins/askrene/child/graph.h:122–127  ·  view source on GitHub ↗

Used to loop over the arcs that exit a node. * * for example: * * void show(struct graph *graph, struct node node) { * printf("Showing node %" PRIu32 "\n", node.idx); * for (struct arc arc = node_adjacency_begin(graph, node); * !node_adjacency_end(arc); * arc = node_adjacency_next(graph, arc)) { * printf("arc id: %" PRIu32 ", (%" PRIu32 " -> %" PRIu32 ")\n", * ar

Source from the content-addressed store, hash-verified

120 * }
121 * */
122static inline struct arc node_adjacency_begin(const struct graph *graph,
123 const struct node node)
124{
125 assert(node.idx < graph_max_num_nodes(graph));
126 return graph->node_adjacency_first[node.idx];
127}
128static inline bool node_adjacency_end(const struct arc arc)
129{
130 return arc.idx == INVALID_INDEX;

Callers 9

BFS_pathFunction · 0.70
dijkstra_pathFunction · 0.70
node_balanceFunction · 0.70
dijkstra_nearest_sinkFunction · 0.70
get_flow_pathsFunction · 0.70
node_rev_adjacency_beginFunction · 0.70
showFunction · 0.50
showFunction · 0.50
showFunction · 0.50

Calls 1

graph_max_num_nodesFunction · 0.85

Tested by 3

showFunction · 0.40
showFunction · 0.40
showFunction · 0.40