MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / Graph_EnsureNodeCap

Function Graph_EnsureNodeCap

src/serializers/graph_extensions.c:14–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12bool Graph_FormConnection(Graph *g, NodeID src, NodeID dest, EdgeID edge_id, int r);
13
14void Graph_EnsureNodeCap
15(
16 Graph *g,
17 uint64_t cap
18) {
19 DataBlock_Ensure(g->nodes, cap);
20
21 uint n;
22 GrB_Index dim = Graph_RequiredMatrixDim(g);
23 RG_Matrix M = NULL;
24
25 M = Graph_GetAdjacencyMatrix(g, false);
26 RG_Matrix_resize(M, dim, dim);
27
28 M = Graph_GetNodeLabelMatrix(g);
29 RG_Matrix_resize(M, dim, dim);
30
31 n = array_len(g->labels);
32 for(int i = 0; i < n; i ++) {
33 M = Graph_GetLabelMatrix(g, i);
34 RG_Matrix_resize(M, dim, dim);
35 }
36
37 n = array_len(g->relations);
38 for(int i = 0; i < n; i ++) {
39 M = Graph_GetRelationMatrix(g, i, false);
40 RG_Matrix_resize(M, dim, dim);
41 }
42}
43
44inline void Serializer_Graph_MarkEdgeDeleted
45(

Callers 3

Serializer_Graph_SetNodeFunction · 0.85
Serializer_Graph_SetEdgeFunction · 0.85

Calls 8

DataBlock_EnsureFunction · 0.85
Graph_RequiredMatrixDimFunction · 0.85
Graph_GetAdjacencyMatrixFunction · 0.85
RG_Matrix_resizeFunction · 0.85
Graph_GetNodeLabelMatrixFunction · 0.85
array_lenFunction · 0.85
Graph_GetLabelMatrixFunction · 0.85
Graph_GetRelationMatrixFunction · 0.85

Tested by

no test coverage detected