Locates edges connecting src to destination.
| 133 | |
| 134 | // Locates edges connecting src to destination. |
| 135 | void _Graph_GetEdgesConnectingNodes |
| 136 | ( |
| 137 | const Graph *g, |
| 138 | NodeID src, |
| 139 | NodeID dest, |
| 140 | int r, |
| 141 | Edge **edges |
| 142 | ) { |
| 143 | ASSERT(g); |
| 144 | ASSERT(r != GRAPH_NO_RELATION); |
| 145 | ASSERT(r < Graph_RelationTypeCount(g)); |
| 146 | ASSERT(src < Graph_RequiredMatrixDim(g)); |
| 147 | ASSERT(dest < Graph_RequiredMatrixDim(g)); |
| 148 | |
| 149 | // relation map, maps (src, dest, r) to edge IDs. |
| 150 | EdgeID id = INVALID_ENTITY_ID; |
| 151 | RG_Matrix M = Graph_GetRelationMatrix(g, r, false); |
| 152 | GrB_Info res = RG_Matrix_extractElement_UINT64(&id, M, src, dest); |
| 153 | |
| 154 | // no entry at [dest, src], src is not connected to dest with relation R |
| 155 | if(res == GrB_NO_VALUE) return; |
| 156 | |
| 157 | _CollectEdgesFromEntry(g, src, dest, r, id, edges); |
| 158 | } |
| 159 | |
| 160 | static inline AttributeSet *_Graph_GetEntity(const DataBlock *entities, EntityID id) { |
| 161 | return DataBlock_GetItem(entities, id); |
no test coverage detected