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

Function Graph_GetRelationMatrix

src/graph/graph.c:1281–1304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1279}
1280
1281RG_Matrix Graph_GetRelationMatrix
1282(
1283 const Graph *g,
1284 RelationID relation_idx,
1285 bool transposed
1286) {
1287 ASSERT(g);
1288 ASSERT(relation_idx == GRAPH_NO_RELATION ||
1289 relation_idx < Graph_RelationTypeCount(g));
1290
1291 RG_Matrix m = GrB_NULL;
1292
1293 if(relation_idx == GRAPH_NO_RELATION) {
1294 m = g->adjacency_matrix;
1295 } else {
1296 m = g->relations[relation_idx];
1297 }
1298
1299 g->SynchronizeMatrix(g, m);
1300
1301 if(transposed) m = RG_Matrix_getTranspose(m);
1302
1303 return m;
1304}
1305
1306RG_Matrix Graph_GetAdjacencyMatrix
1307(

Calls 2

Graph_RelationTypeCountFunction · 0.85
RG_Matrix_getTransposeFunction · 0.85

Tested by 2

_bind_matricesFunction · 0.68
test_removeNodesFunction · 0.68