| 1279 | } |
| 1280 | |
| 1281 | RG_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 | |
| 1306 | RG_Matrix Graph_GetAdjacencyMatrix |
| 1307 | ( |