GraphClear
Description
Clear all nodes and edges but retain allocated storage.
Existing live node handles become invalid after clear. Internal slot storage is retained so new nodes can reuse it with fresh generations.
Parameters
| Name | Direction | Description |
|---|---|---|
g |
in,out | Graph to clear. |
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Graph.Init.c:8:
static bool test_graph_reserve_clear(void) {
WriteFmt("Testing GraphReserve and GraphClear\n");
typedef Graph(int) IntGraph;- In
Graph.Init.c:35:
result = result && GraphMarkEdgeForRemoval(&graph, third_id, third_id);
GraphClear(&graph);
result = result && GraphNodeCount(&graph) == 0 && GraphEdgeCount(&graph) == 0 && GraphEmpty(&graph);
Last updated on