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

[sampling][status] add reset functionality

parent 0243cf12
......@@ -25,7 +25,10 @@
#ifndef FRACKIT_SAMPLING_STATUS_HH
#define FRACKIT_SAMPLING_STATUS_HH
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <initializer_list>
......@@ -53,6 +56,24 @@ public:
auto it = count_.find(id.get());
if (it == count_.end())
count_[id.get()] = 0;
else if (it->second > targetCount)
std::cout << "Warning: given target count is below current count" << std::endl;
}
/*!
* \brief Reset all counters.
*/
void resetCounters()
{
for (auto& count : count_) count.second = 0;
}
/*!
* \brief Reset counter for the given id.
*/
void resetCounter(const Id& id)
{
count_[id.get()] = 0;
}
/*!
......
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