| 13 | typedef std::unordered_map<size_t, size_t> IndexHash; |
| 14 | |
| 15 | IndexHash compute_next_map(const MatrixIr& edges) { |
| 16 | IndexHash next; |
| 17 | const size_t num_edges = edges.rows(); |
| 18 | for (size_t i=0; i<num_edges; i++) { |
| 19 | const auto& e = edges.row(i); |
| 20 | next[e[0]] = e[1]; |
| 21 | } |
| 22 | return next; |
| 23 | } |
| 24 | |
| 25 | IndexHash compute_valance(const MatrixIr& edges) { |
| 26 | IndexHash valance; |