mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Several performance fixes (#9026)
* #9023 Performance: Use count instead of for loop * #9023 Analyzer: Cache vector names for categories * #9023 Performance : Use cached ensemble analyzer * #9023 Performance : Add min/max values to ensemble statistics * #9023 Performance : Improve statistics calculator * #9023 Performance : Use high performance toInt() * #9023 Performance : Build summary addresses in parallell
This commit is contained in:
@@ -105,20 +105,16 @@ void RigStatisticsMath::calculateStatisticsCurves( const std::vector<double>& va
|
||||
P90
|
||||
};
|
||||
|
||||
std::vector<double> sortedValues;
|
||||
double valueSum = 0;
|
||||
std::vector<double> sortedValues = values;
|
||||
|
||||
{
|
||||
std::multiset<double> vSet( values.begin(), values.end() );
|
||||
for ( double v : vSet )
|
||||
{
|
||||
if ( RiaStatisticsTools::isValidNumber( v ) )
|
||||
{
|
||||
sortedValues.push_back( v );
|
||||
valueSum += v;
|
||||
}
|
||||
}
|
||||
}
|
||||
sortedValues.erase( std::remove_if( sortedValues.begin(),
|
||||
sortedValues.end(),
|
||||
[]( double x ) { return !RiaStatisticsTools::isValidNumber( x ); } ),
|
||||
sortedValues.end() );
|
||||
|
||||
std::sort( sortedValues.begin(), sortedValues.end() );
|
||||
|
||||
double valueSum = std::accumulate( sortedValues.begin(), sortedValues.end(), 0.0 );
|
||||
|
||||
int valueCount = (int)sortedValues.size();
|
||||
double percentiles[] = { 0.1, 0.5, 0.9 };
|
||||
|
||||
Reference in New Issue
Block a user