Commit cead7b53 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[sampling][status] add return function for counts

parent 39aab9df
......@@ -25,6 +25,7 @@
#ifndef FRACKIT_SAMPLING_STATUS_HH
#define FRACKIT_SAMPLING_STATUS_HH
#include <algorithm>
#include <unordered_map>
#include <initializer_list>
......@@ -94,6 +95,24 @@ public:
rejectedCount_++;
}
/*!
* \brief Returns the entity count for the given id.
*/
std::size_t getCount(const Id& id)
{ return count_[id.get()]; }
/*!
* \brief Returns the overall entity count.
*/
std::size_t getCount()
{
return std::accumulate(count_.begin(),
count_.end(),
0,
[] (const auto& curCount, const auto& idCountPair)
{ return curCount + idCountPair.second; });
}
/*!
* \brief Print current status to terminal.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment