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
acedc700
Commit
acedc700
authored
Aug 21, 2015
by
Tiago Peixoto
Browse files
graph_blockmodel.hh: Return const references in egroup sampling
parent
8d806b4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph/community/graph_blockmodel.hh
View file @
acedc700
...
...
@@ -2010,15 +2010,15 @@ struct egroups_manage
}
template
<
class
Edge
,
class
RNG
>
static
typename
std
::
tuple_element
<
0
,
Edge
>::
type
sample_edge
(
DynamicSampler
<
Edge
>&
elist
,
RNG
&
rng
)
static
const
typename
std
::
tuple_element
<
0
,
Edge
>::
type
&
sample_edge
(
const
DynamicSampler
<
Edge
>&
elist
,
RNG
&
rng
)
{
return
get
<
0
>
(
elist
.
sample
(
rng
));
}
template
<
class
Edge
,
class
RNG
>
static
typename
std
::
tuple_element
<
0
,
Edge
>::
type
sample_edge
(
vector
<
Edge
>&
elist
,
RNG
&
rng
)
static
const
typename
std
::
tuple_element
<
0
,
Edge
>::
type
&
sample_edge
(
const
vector
<
Edge
>&
elist
,
RNG
&
rng
)
{
std
::
uniform_int_distribution
<
size_t
>
urand
(
0
,
elist
.
size
()
-
1
);
size_t
ur
=
urand
(
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