Unverified Commit 2e8b56a3 authored by Eric Kim's avatar Eric Kim Committed by GitHub
Browse files

[Randomwalk] Fix off-by-one bug in GenericRandomWalk() (#3500)

parent 863c2495
...@@ -59,7 +59,7 @@ std::pair<IdArray, IdArray> GenericRandomWalk( ...@@ -59,7 +59,7 @@ std::pair<IdArray, IdArray> GenericRandomWalk(
CHECK_LT(curr, max_nodes) << "Seed node ID exceeds the maximum number of nodes."; CHECK_LT(curr, max_nodes) << "Seed node ID exceeds the maximum number of nodes.";
for (i = 0; i < max_num_steps; ++i) { for (i = 0; i < max_num_steps; ++i) {
const auto &succ = step(traces_data + seed_id * max_num_steps, curr, i); const auto &succ = step(traces_data + seed_id * trace_length, curr, i);
traces_data[seed_id * trace_length + i + 1] = curr = std::get<0>(succ); traces_data[seed_id * trace_length + i + 1] = curr = std::get<0>(succ);
eids_data[seed_id * max_num_steps + i] = std::get<1>(succ); eids_data[seed_id * max_num_steps + i] = std::get<1>(succ);
if (std::get<2>(succ)) if (std::get<2>(succ))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment