Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
2e8b56a3
Unverified
Commit
2e8b56a3
authored
Nov 15, 2021
by
Eric Kim
Committed by
GitHub
Nov 15, 2021
Browse files
[Randomwalk] Fix off-by-one bug in GenericRandomWalk() (#3500)
parent
863c2495
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/graph/sampling/randomwalks/randomwalks_cpu.h
src/graph/sampling/randomwalks/randomwalks_cpu.h
+1
-1
No files found.
src/graph/sampling/randomwalks/randomwalks_cpu.h
View file @
2e8b56a3
...
@@ -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
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment