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:
@@ -83,6 +83,19 @@ void RigEclipseNativeStatCalc::addDataToHistogramCalculator(size_t timeStepIndex
|
||||
histogramCalculator.addData(values);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseNativeStatCalc::uniqueValues(size_t timeStepIndex, std::set<int>& values)
|
||||
{
|
||||
std::vector<double>& doubleValues = m_resultsData->cellScalarResults(m_scalarResultIndex, timeStepIndex);
|
||||
|
||||
for (size_t cIdx = 0; cIdx < doubleValues.size(); ++cIdx)
|
||||
{
|
||||
values.insert(std::floor(doubleValues[cIdx]));
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user