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
8d806b4e
Commit
8d806b4e
authored
Aug 21, 2015
by
Tiago Peixoto
Browse files
dynamic_sampler.hh: Impose const correctness
parent
d2e7d4f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph/generation/dynamic_sampler.hh
View file @
8d806b4e
...
...
@@ -43,12 +43,12 @@ public:
typedef
Value
value_type
;
size_t
get_left
(
size_t
i
)
{
return
2
*
i
+
1
;
}
size_t
get_right
(
size_t
i
)
{
return
2
*
i
+
2
;
}
size_t
get_parent
(
size_t
i
)
{
return
i
>
0
?
(
i
-
1
)
/
2
:
0
;
}
size_t
get_left
(
size_t
i
)
const
{
return
2
*
i
+
1
;
}
size_t
get_right
(
size_t
i
)
const
{
return
2
*
i
+
2
;
}
size_t
get_parent
(
size_t
i
)
const
{
return
i
>
0
?
(
i
-
1
)
/
2
:
0
;
}
template
<
class
RNG
>
const
Value
&
sample
(
RNG
&
rng
)
const
Value
&
sample
(
RNG
&
rng
)
const
{
uniform_real_distribution
<>
sample
(
0
,
1
);
double
u
=
_tree
[
0
]
*
sample
(
rng
),
c
=
0
;
...
...
Write
Preview
Supports
Markdown
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