| 61 | } |
| 62 | |
| 63 | void StaticRandomWalkerImpl::MetaPathTraverse( |
| 64 | const vec_int_t& cur_nodes, const std::vector<int>& walk_lens, |
| 65 | const WalkerInfo& walker_info, std::vector<vec_int_t>* seqs) const { |
| 66 | seqs->clear(); |
| 67 | seqs->resize(cur_nodes.size()); |
| 68 | int_t next_node; |
| 69 | for (size_t i = 0; i < cur_nodes.size(); ++i) { |
| 70 | auto cur_node = cur_nodes[i]; |
| 71 | auto cur_index = walker_info.walker_length - walk_lens[i]; |
| 72 | |
| 73 | for (int j = cur_index; j < walker_info.walker_length; ++j) { |
| 74 | if (MetaPathNext(walker_info.meta_path, cur_node, j, &next_node)) { |
| 75 | (*seqs)[i].emplace_back(next_node); |
| 76 | cur_node = next_node; |
| 77 | } else { |
| 78 | break; |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | bool StaticRandomWalkerImpl::MetaPathNext(const meta_path_t& meta_path, |
| 85 | int_t cur_node, int cur_index, |