Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpp-statistics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Humanoid Path Planner
hpp-statistics
Commits
9fc3efa4
Commit
9fc3efa4
authored
10 years ago
by
Joseph Mirabel
Committed by
Joseph Mirabel
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add method Statistics::insert
parent
5a36b447
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/hpp/statistics/bin.hh
+23
-0
23 additions, 0 deletions
include/hpp/statistics/bin.hh
with
23 additions
and
0 deletions
include/hpp/statistics/bin.hh
+
23
−
0
View file @
9fc3efa4
...
@@ -115,6 +115,11 @@ namespace hpp {
...
@@ -115,6 +115,11 @@ namespace hpp {
/// already in the set.
/// already in the set.
virtual
T
&
increment
(
const
T
&
bin
)
__attribute__
((
deprecated
));
virtual
T
&
increment
(
const
T
&
bin
)
__attribute__
((
deprecated
));
/// insert a Bin.
/// \note bin is inserted in the set of bins if it was not
/// already in the set.
virtual
iterator
insert
(
const
T
&
bin
);
iterator
find
(
const
T
&
bin
);
iterator
find
(
const
T
&
bin
);
template
<
typename
U
>
iterator
find
(
const
U
&
value
);
template
<
typename
U
>
iterator
find
(
const
U
&
value
);
...
@@ -166,6 +171,24 @@ namespace hpp {
...
@@ -166,6 +171,24 @@ namespace hpp {
return
*
it
;
return
*
it
;
}
}
template
<
typename
T
>
typename
Statistics
<
T
>::
iterator
Statistics
<
T
>::
insert
(
const
T
&
b
)
{
counts_
++
;
iterator
it
=
bins_
.
begin
();
for
(;
it
!=
bins_
.
end
();
it
++
)
{
if
(
!
(
*
it
<
b
))
{
if
(
!
(
*
it
==
b
))
it
=
bins_
.
insert
(
it
,
b
);
(
*
it
)
++
;
return
it
;
}
}
it
=
bins_
.
insert
(
it
,
b
);
(
*
it
)
++
;
return
it
;
}
template
<
typename
T
>
template
<
typename
T
>
typename
Statistics
<
T
>::
iterator
Statistics
<
T
>::
find
(
const
T
&
b
)
typename
Statistics
<
T
>::
iterator
Statistics
<
T
>::
find
(
const
T
&
b
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment