in the background add the actual arc or dual arc */
| 3 | |
| 4 | /* in the background add the actual arc or dual arc */ |
| 5 | static void graph_push_outbound_arc(struct graph *graph, const struct arc arc, |
| 6 | const struct node node) |
| 7 | { |
| 8 | assert(arc.idx < graph_max_num_arcs(graph)); |
| 9 | assert(node.idx < graph_max_num_nodes(graph)); |
| 10 | |
| 11 | /* arc is already added, skip */ |
| 12 | if (graph->arc_tail[arc.idx].idx != INVALID_INDEX) |
| 13 | return; |
| 14 | |
| 15 | graph->arc_tail[arc.idx] = node; |
| 16 | |
| 17 | const struct arc first_arc = graph->node_adjacency_first[node.idx]; |
| 18 | graph->node_adjacency_next[arc.idx] = first_arc; |
| 19 | graph->node_adjacency_first[node.idx] = arc; |
| 20 | } |
| 21 | |
| 22 | bool graph_add_arc(struct graph *graph, const struct arc arc, |
| 23 | const struct node from, const struct node to) |
no test coverage detected