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
e1c4eba6
Commit
e1c4eba6
authored
10 years ago
by
Joseph Mirabel
Committed by
Joseph Mirabel
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add class SuccessBin
parent
3a28c5ef
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+1
-0
1 addition, 0 deletions
CMakeLists.txt
include/hpp/statistics/success-bin.hh
+59
-0
59 additions, 0 deletions
include/hpp/statistics/success-bin.hh
src/CMakeLists.txt
+1
-0
1 addition, 0 deletions
src/CMakeLists.txt
src/success-bin.cc
+53
-0
53 additions, 0 deletions
src/success-bin.cc
with
114 additions
and
0 deletions
CMakeLists.txt
+
1
−
0
View file @
e1c4eba6
...
@@ -37,6 +37,7 @@ ENDIF()
...
@@ -37,6 +37,7 @@ ENDIF()
SET
(
${
PROJECT_NAME
}
_HEADERS
SET
(
${
PROJECT_NAME
}
_HEADERS
include/hpp/statistics/bin.hh
include/hpp/statistics/bin.hh
include/hpp/statistics/success-bin.hh
)
)
# Add dependency toward hpp-model library in pkg-config file.
# Add dependency toward hpp-model library in pkg-config file.
...
...
This diff is collapsed.
Click to expand it.
include/hpp/statistics/success-bin.hh
0 → 100644
+
59
−
0
View file @
e1c4eba6
// Copyright (c) 2014, LAAS-CNRS
// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
//
// This file is part of hpp-statistics.
// hpp-statistics is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// hpp-statistics is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// hpp-statistics. If not, see <http://www.gnu.org/licenses/>.
#ifndef HPP_MANIPULATION_GRAPH_STATISTICS_HH
# define HPP_MANIPULATION_GRAPH_STATISTICS_HH
# include <ostream>
# include <hpp/statistics/config.hh>
# include "hpp/statistics/bin.hh"
namespace
hpp
{
namespace
statistics
{
/// This class count the number of success and failure.
class
HPP_STATISTICS_DLLAPI
SuccessBin
:
public
Bin
{
public:
/// Constructor
SuccessBin
(
const
bool
success
);
/// Value of the bin.
/// \return True is it counts "success", False otherwise.
bool
isSuccess
()
const
;
/// Add an occurence
/// \return The frequency after increment;
size_t
operator
++
();
/// Add an occurence
/// \return The frequency before increment;
size_t
operator
++
(
int
);
/// \return The number of element in the bin.
size_t
freq
()
const
;
private:
bool
success_
;
size_t
freq_
;
std
::
ostream
&
printValue
(
std
::
ostream
&
os
)
const
;
};
}
// namespace statistics
}
// namespace hpp
#endif // HPP_MANIPULATION_GRAPH_STATISTICS_HH
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
+
1
−
0
View file @
e1c4eba6
...
@@ -21,6 +21,7 @@ SET(LIBRARY_NAME ${PROJECT_NAME})
...
@@ -21,6 +21,7 @@ SET(LIBRARY_NAME ${PROJECT_NAME})
ADD_LIBRARY
(
${
LIBRARY_NAME
}
SHARED
ADD_LIBRARY
(
${
LIBRARY_NAME
}
SHARED
bin.cc
bin.cc
success-bin.cc
)
)
INSTALL
(
TARGETS
${
LIBRARY_NAME
}
DESTINATION lib
)
INSTALL
(
TARGETS
${
LIBRARY_NAME
}
DESTINATION lib
)
This diff is collapsed.
Click to expand it.
src/success-bin.cc
0 → 100644
+
53
−
0
View file @
e1c4eba6
// Copyright (c) 2014, LAAS-CNRS
// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
//
// This file is part of hpp-statistics.
// hpp-statistics is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the License, or (at your option) any later version.
//
// hpp-statistics is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Lesser Public License for more details. You should have
// received a copy of the GNU Lesser General Public License along with
// hpp-statistics. If not, see <http://www.gnu.org/licenses/>.
#include
"hpp/statistics/success-bin.hh"
namespace
hpp
{
namespace
statistics
{
SuccessBin
::
SuccessBin
(
const
bool
success
)
:
success_
(
success
),
freq_
(
0
)
{}
bool
SuccessBin
::
isSuccess
()
const
{
return
success_
;
}
size_t
SuccessBin
::
freq
()
const
{
return
freq_
;
}
size_t
SuccessBin
::
operator
++
()
{
return
++
freq_
;
}
size_t
SuccessBin
::
operator
++
(
int
)
{
return
freq_
++
;
}
std
::
ostream
&
SuccessBin
::
printValue
(
std
::
ostream
&
os
)
const
{
os
<<
"Event "
;
if
(
success_
)
os
<<
"'Success'"
;
else
os
<<
"'Failure'"
;
return
os
;
}
}
// namespace statistics
}
// namespace hpp
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