MCPcopy Create free account
hub / github.com/IBM/Project_CodeNet / mk_adjacency_graph

Function mk_adjacency_graph

tools/json-graph/src/jgflib.c:174–185  ·  view source on GitHub ↗

Convert (nodelist,edgelist) graph into explicit adjacency structure. Assume graph is directed. */

Source from the content-addressed store, hash-verified

172 Assume graph is directed.
173*/
174void mk_adjacency_graph(Graph g)
175{
176 Edge e;
177 assert(g->directed);
178 for (e = g->edges; e; e = e->next) {
179 Node from = node_find(g, e->between[0]);
180 Node to = node_find(g, e->between[1]);
181 assert(from);
182 assert(to);
183 adj_edge_add(from, e, to);
184 }
185}
186
187/** Get input file as one long string in global input.
188 Returns number of bytes read.

Callers 1

mainFunction · 0.85

Calls 2

node_findFunction · 0.85
adj_edge_addFunction · 0.85

Tested by

no test coverage detected