mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#282) Added basic data structures to compute and cache unique integer values
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
|
||||
@@ -131,3 +132,18 @@ public:
|
||||
double valueSum;
|
||||
size_t sampleCount;
|
||||
};
|
||||
|
||||
|
||||
class UniqueValueAccumulator
|
||||
{
|
||||
public:
|
||||
UniqueValueAccumulator()
|
||||
{}
|
||||
|
||||
void addValue(double value)
|
||||
{
|
||||
uniqueValues.insert(static_cast<int>(value));
|
||||
}
|
||||
|
||||
std::set<int> uniqueValues;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user