mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Copy changes from dev-branch into main
History of main branch was difficult to merge. Take a copy of dev-branch, and merge both ways between dev and main after the release.
This commit is contained in:
@@ -30,7 +30,7 @@ void RigStatisticsCalculator::meanCellScalarValue( double& meanValue )
|
||||
double valueSum = 0.0;
|
||||
size_t sampleCount = 0;
|
||||
|
||||
this->valueSumAndSampleCount( valueSum, sampleCount );
|
||||
valueSumAndSampleCount( valueSum, sampleCount );
|
||||
|
||||
if ( sampleCount == 0 )
|
||||
{
|
||||
@@ -50,7 +50,7 @@ void RigStatisticsCalculator::meanCellScalarValue( size_t timeStepIndex, double&
|
||||
double valueSum = 0.0;
|
||||
size_t sampleCount = 0;
|
||||
|
||||
this->valueSumAndSampleCount( timeStepIndex, valueSum, sampleCount );
|
||||
valueSumAndSampleCount( timeStepIndex, valueSum, sampleCount );
|
||||
|
||||
if ( sampleCount == 0 )
|
||||
{
|
||||
@@ -67,10 +67,10 @@ void RigStatisticsCalculator::meanCellScalarValue( size_t timeStepIndex, double&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStatisticsCalculator::valueSumAndSampleCount( double& valueSum, size_t& sampleCount )
|
||||
{
|
||||
size_t tsCount = this->timeStepCount();
|
||||
size_t tsCount = timeStepCount();
|
||||
for ( size_t tIdx = 0; tIdx < tsCount; tIdx++ )
|
||||
{
|
||||
this->valueSumAndSampleCount( tIdx, valueSum, sampleCount );
|
||||
valueSumAndSampleCount( tIdx, valueSum, sampleCount );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,10 +79,10 @@ void RigStatisticsCalculator::valueSumAndSampleCount( double& valueSum, size_t&
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStatisticsCalculator::addDataToHistogramCalculator( RigHistogramCalculator& histogramCalculator )
|
||||
{
|
||||
size_t tsCount = this->timeStepCount();
|
||||
size_t tsCount = timeStepCount();
|
||||
for ( size_t tIdx = 0; tIdx < tsCount; tIdx++ )
|
||||
{
|
||||
this->addDataToHistogramCalculator( tIdx, histogramCalculator );
|
||||
addDataToHistogramCalculator( tIdx, histogramCalculator );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,11 +99,11 @@ void RigStatisticsCalculator::mobileVolumeWeightedMean( size_t timeStepIndex, do
|
||||
void RigStatisticsCalculator::mobileVolumeWeightedMean( double& mean )
|
||||
{
|
||||
double sum = 0.0;
|
||||
size_t tsCount = this->timeStepCount();
|
||||
size_t tsCount = timeStepCount();
|
||||
for ( size_t tIdx = 0; tIdx < tsCount; tIdx++ )
|
||||
{
|
||||
double meanForTimeStep;
|
||||
this->mobileVolumeWeightedMean( tIdx, meanForTimeStep );
|
||||
mobileVolumeWeightedMean( tIdx, meanForTimeStep );
|
||||
sum += meanForTimeStep;
|
||||
}
|
||||
if ( tsCount != 0 )
|
||||
|
||||
@@ -75,7 +75,7 @@ void RigStatisticsDataCache::minMaxCellScalarValues( double& min, double& max )
|
||||
for ( i = 0; i < m_statisticsCalculator->timeStepCount(); i++ )
|
||||
{
|
||||
double tsmin, tsmax;
|
||||
this->minMaxCellScalarValues( i, tsmin, tsmax );
|
||||
minMaxCellScalarValues( i, tsmin, tsmax );
|
||||
if ( tsmin < min ) min = tsmin;
|
||||
if ( tsmax > max ) max = tsmax;
|
||||
}
|
||||
@@ -130,7 +130,7 @@ void RigStatisticsDataCache::posNegClosestToZero( double& pos, double& neg )
|
||||
for ( i = 0; i < m_statisticsCalculator->timeStepCount(); i++ )
|
||||
{
|
||||
double tsNeg, tsPos;
|
||||
this->posNegClosestToZero( i, tsPos, tsNeg );
|
||||
posNegClosestToZero( i, tsPos, tsNeg );
|
||||
if ( tsNeg > neg && tsNeg < 0 ) neg = tsNeg;
|
||||
if ( tsPos < pos && tsPos > 0 ) pos = tsPos;
|
||||
}
|
||||
@@ -215,7 +215,7 @@ void RigStatisticsDataCache::sumCellScalarValues( double& sumValue )
|
||||
for ( size_t i = 0; i < m_statisticsCalculator->timeStepCount(); i++ )
|
||||
{
|
||||
double valueSum = 0.0;
|
||||
this->sumCellScalarValues( i, valueSum );
|
||||
sumCellScalarValues( i, valueSum );
|
||||
|
||||
aggregatedSum += valueSum;
|
||||
}
|
||||
@@ -390,7 +390,7 @@ void RigStatisticsDataCache::computeHistogramStatisticsIfNeeded()
|
||||
{
|
||||
double min;
|
||||
double max;
|
||||
this->minMaxCellScalarValues( min, max );
|
||||
minMaxCellScalarValues( min, max );
|
||||
|
||||
RigHistogramCalculator histCalc( min, max, m_numBins, &m_statsAllTimesteps.m_histogram );
|
||||
|
||||
@@ -410,7 +410,7 @@ void RigStatisticsDataCache::computeHistogramStatisticsIfNeeded( size_t timeStep
|
||||
{
|
||||
double min;
|
||||
double max;
|
||||
this->minMaxCellScalarValues( timeStepIndex, min, max );
|
||||
minMaxCellScalarValues( timeStepIndex, min, max );
|
||||
|
||||
RigHistogramCalculator histCalc( min, max, m_numBins, &m_statsPrTs[timeStepIndex].m_histogram );
|
||||
|
||||
@@ -426,7 +426,7 @@ void RigStatisticsDataCache::computeHistogramStatisticsIfNeeded( size_t timeStep
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStatisticsDataCache::computeUniqueValuesIfNeeded()
|
||||
{
|
||||
if ( m_statsAllTimesteps.m_uniqueValues.size() == 0 )
|
||||
if ( m_statsAllTimesteps.m_uniqueValues.empty() )
|
||||
{
|
||||
std::set<int> setValues;
|
||||
m_statisticsCalculator->uniqueValues( 0, setValues ); // This is a Hack ! Only using first timestep. Ok for
|
||||
@@ -444,7 +444,7 @@ void RigStatisticsDataCache::computeUniqueValuesIfNeeded()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStatisticsDataCache::computeUniqueValuesIfNeeded( size_t timeStepIndex )
|
||||
{
|
||||
if ( m_statsPrTs[timeStepIndex].m_uniqueValues.size() == 0 )
|
||||
if ( m_statsPrTs[timeStepIndex].m_uniqueValues.empty() )
|
||||
{
|
||||
std::set<int> setValues;
|
||||
m_statisticsCalculator->uniqueValues( timeStepIndex, setValues );
|
||||
|
||||
@@ -182,7 +182,7 @@ std::vector<double> RigStatisticsMath::calculateNearestRankPercentiles( const st
|
||||
std::sort( sortedValues.begin(), sortedValues.end() );
|
||||
|
||||
std::vector<double> percentiles( pValPositions.size(), HUGE_VAL );
|
||||
if ( sortedValues.size() )
|
||||
if ( !sortedValues.empty() )
|
||||
{
|
||||
for ( size_t i = 0; i < pValPositions.size(); ++i )
|
||||
{
|
||||
@@ -226,7 +226,7 @@ std::vector<double> RigStatisticsMath::calculateInterpolatedPercentiles( const s
|
||||
std::sort( sortedValues.begin(), sortedValues.end() );
|
||||
|
||||
std::vector<double> percentiles( pValPositions.size(), HUGE_VAL );
|
||||
if ( sortedValues.size() )
|
||||
if ( !sortedValues.empty() )
|
||||
{
|
||||
for ( size_t i = 0; i < pValPositions.size(); ++i )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user