Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
6c3d1149
Commit
6c3d1149
authored
Apr 17, 2016
by
Tiago Peixoto
Browse files
inference: make use of uniform_sample()
parent
95e1e194
Pipeline
#165
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/graph/inference/graph_blockmodel_util.hh
View file @
6c3d1149
...
...
@@ -1207,9 +1207,7 @@ public:
template
<
class
Edge
,
class
RNG
>
const
auto
&
sample_edge
(
const
vector
<
Edge
>&
elist
,
RNG
&
rng
)
{
std
::
uniform_int_distribution
<
size_t
>
urand
(
0
,
elist
.
size
()
-
1
);
size_t
ur
=
urand
(
rng
);
return
get
<
0
>
(
elist
[
ur
]);
return
get
<
0
>
(
uniform_sample
(
elist
,
rng
));
}
template
<
class
Vertex
,
class
RNG
>
...
...
@@ -1296,8 +1294,7 @@ auto sample_neighbour(Sampler& sampler, RNG& rng)
template
<
class
Vertex
,
class
RNG
>
auto
sample_neighbour
(
vector
<
Vertex
>&
sampler
,
RNG
&
rng
)
{
std
::
uniform_int_distribution
<
Vertex
>
rand
(
0
,
sampler
.
size
()
-
1
);
return
sampler
[
rand
(
rng
)];
return
uniform_sample
(
sampler
,
rng
);
}
...
...
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