Skip to content
Snippets Groups Projects
Commit 372cde0a authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Make SuccessStatistics compliant with STL container

parent de7e70c5
No related branches found
No related tags found
No related merge requests found
...@@ -128,6 +128,11 @@ namespace hpp { ...@@ -128,6 +128,11 @@ namespace hpp {
: name_ (name), logRatio_ (logRatio) : name_ (name), logRatio_ (logRatio)
{} {}
/// Copy Constructor
SuccessStatistics (const SuccessStatistics& other)
: name_ (other.name_), logRatio_ (other.logRatio_)
{}
/// Add a 'success' /// Add a 'success'
void addSuccess () void addSuccess ()
{ {
...@@ -150,7 +155,7 @@ namespace hpp { ...@@ -150,7 +155,7 @@ namespace hpp {
{ {
bool lowRatio = (logRatio_ * nbSuccess () < numberOfObservations()); bool lowRatio = (logRatio_ * nbSuccess () < numberOfObservations());
if (autoPrint && lowRatio) if (autoPrint && lowRatio)
hppDout (info, "Success statistics " << name_ << ":\n" << *this); hppDout (info, name_ << ":\n" << *this);
return lowRatio; return lowRatio;
} }
...@@ -172,10 +177,10 @@ namespace hpp { ...@@ -172,10 +177,10 @@ namespace hpp {
return freq (SuccessBin (false, r)); return freq (SuccessBin (false, r));
} }
const std::string name_; std::string name_;
/// If nbSuccess() * logRatio < numberOfObservations(), write to log. /// If nbSuccess() * logRatio < numberOfObservations(), write to log.
const std::size_t logRatio_; std::size_t logRatio_;
}; };
} // namespace statistics } // namespace statistics
} // namespace hpp } // namespace hpp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment