Flatten the adjacency list to an edge list */
| 85 | |
| 86 | /** Flatten the adjacency list to an edge list */ |
| 87 | virtual void flatten() { |
| 88 | if (!edges.empty()) |
| 89 | return; |
| 90 | |
| 91 | size_t offset = 0; |
| 92 | flat_offsets.resize(num_vertex); |
| 93 | for (Index u = 0; u < num_vertex; u++) { |
| 94 | for (auto &&vertex_edge : vertex_edges[u]) { |
| 95 | edges.push_back(std::tuple_cat(std::tie(u), vertex_edge)); |
| 96 | edge_weights.push_back(std::get<1>(vertex_edge)); |
| 97 | } |
| 98 | flat_offsets[u] = offset; |
| 99 | offset += vertex_edges[u].size(); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | virtual inline std::string name() const { |
| 104 | std::stringstream ss; |
no test coverage detected