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:
@@ -137,6 +137,22 @@ void RigFemNativeStatCalc::addDataToHistogramCalculator(size_t timeStepIndex, Ri
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFemNativeStatCalc::uniqueValues(size_t timeStepIndex, std::set<int>& values)
|
||||
{
|
||||
for (int pIdx = 0; pIdx < m_resultsData->partCount(); ++pIdx)
|
||||
{
|
||||
const std::vector<float>& floatValues = m_resultsData->resultValues(m_resVarAddr, pIdx, (int)timeStepIndex);
|
||||
|
||||
for (size_t i = 0; i < floatValues.size(); i++)
|
||||
{
|
||||
values.insert(static_cast<int>(std::floor(floatValues[i])));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user