Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
graph-tool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
43
Issues
43
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tiago Peixoto
graph-tool
Commits
8d806b4e
Commit
8d806b4e
authored
Aug 21, 2015
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dynamic_sampler.hh: Impose const correctness
parent
d2e7d4f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/graph/generation/dynamic_sampler.hh
src/graph/generation/dynamic_sampler.hh
+4
-4
No files found.
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
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