GraphNodeCount
Description
Number of live nodes currently stored in graph.
Parameters
| Name | Direction | Description |
|---|---|---|
g |
in | Graph to query. |
Success
Live node count.
Failure
Function cannot fail.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Graph.Ops.c:53:
result = result && (removed == 1);
result = result && (GraphNodeCount(&graph) == 2);
result = result && (GraphEdgeCount(&graph) == 1);
result = result && !GraphContainsNode(&graph, b);- In
Graph.Ops.c:91:
result = result && (GraphCommitChanges(&graph) == 0);
result = result && GraphContainsNode(&graph, a);
result = result && (GraphNodeCount(&graph) == 1);
GraphDeinit(&graph);- In
Graph.Ops.c:244:
result = result && (GraphCommitChanges(&graph) == 2);
result = result && !GraphContainsNode(&graph, b);
result = result && (GraphNodeCount(&graph) == 3);
result = result && (GraphEdgeCount(&graph) == 0);
result = result && (GraphOutDegree(&graph, a) == 0);- In
Graph.Init.c:37:
GraphClear(&graph);
result = result && GraphNodeCount(&graph) == 0 && GraphEdgeCount(&graph) == 0 && GraphEmpty(&graph);
result = result && !GraphContainsNode(&graph, first_id) && !GraphContainsNode(&graph, second_id);
result = result && !GraphContainsNode(&graph, third_id);- In
Graph.Init.c:75:
stored_name = GraphNodeDataPtr(&graph, node);
bool result = GraphNodeIdIndex(node_id) == 0 && name.data != NULL && GraphNodeCount(&graph) == 1 &&
ZstrCompare(stored_name->data, "alpha") == 0 && stored_name->data != name.data;- In
Graph.Type.c:14:
ValidateGraph(&graph);
bool result = GraphNodeCount(&graph) == 0 && GraphEdgeCount(&graph) == 0 && GraphEmpty(&graph) &&
graph.slots.data == NULL && graph.free_indices.data == NULL &&
graph.pending_edge_removals.data == NULL && graph.copy_init == NULL && graph.copy_deinit == NULL && *GraphNodeDataPtr(&graph, node_b) = 25;
bool result = GraphNodeCount(&graph) == 3 && GraphEdgeCount(&graph) == 3 && !GraphEmpty(&graph);
result = result && GraphContainsNode(&graph, a) && GraphContainsNode(&graph, b) && GraphContainsNode(&graph, c);
result = result && GraphNodeAt(&graph, b) == 25;- In
Foreach.h:32:
#define GraphForeachNode(g, node) \
for (TYPE_OF(g) UNPL(pg) = (g); UNPL(pg); UNPL(pg) = NULL) \
if ((ValidateGraph(UNPL(pg)), 1) && GraphNodeCount(UNPL(pg)) > 0) \
for (GenericGraphNodeIter UNPL(iter) = graph_node_iter_begin(GENERIC_GRAPH(UNPL(pg))); UNPL(iter).graph; \
UNPL(iter).graph = NULL) \- In
Access.h:47:
/// TAGS: Graph, Empty, Query
///
#define GraphEmpty(g) (GraphNodeCount(g) == 0)
///
Last updated on