mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7190 Correlation Parameters : Fix cache inconsistencies
This commit is contained in:
parent
493f257e5e
commit
97114f4554
@ -452,36 +452,49 @@ RifReaderRftInterface* RimSummaryCaseCollection::rftStatisticsReader()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
const std::vector<EnsembleParameter>&
|
std::vector<EnsembleParameter> RimSummaryCaseCollection::variationSortedEnsembleParameters( bool excludeNoVariation ) const
|
||||||
RimSummaryCaseCollection::variationSortedEnsembleParameters( bool excludeNoVariation ) const
|
|
||||||
{
|
{
|
||||||
if ( m_cachedSortedEnsembleParameters.size() ) return m_cachedSortedEnsembleParameters;
|
if ( m_cachedSortedEnsembleParameters.empty() )
|
||||||
|
|
||||||
std::set<QString> paramSet;
|
|
||||||
for ( RimSummaryCase* rimCase : this->allSummaryCases() )
|
|
||||||
{
|
{
|
||||||
if ( rimCase->caseRealizationParameters() != nullptr )
|
std::set<QString> paramSet;
|
||||||
|
for ( RimSummaryCase* rimCase : this->allSummaryCases() )
|
||||||
{
|
{
|
||||||
auto ps = rimCase->caseRealizationParameters()->parameters();
|
if ( rimCase->caseRealizationParameters() != nullptr )
|
||||||
for ( auto p : ps )
|
|
||||||
{
|
{
|
||||||
paramSet.insert( p.first );
|
auto ps = rimCase->caseRealizationParameters()->parameters();
|
||||||
|
for ( const auto& p : ps )
|
||||||
|
{
|
||||||
|
paramSet.insert( p.first );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
m_cachedSortedEnsembleParameters.reserve( paramSet.size() );
|
m_cachedSortedEnsembleParameters.reserve( paramSet.size() );
|
||||||
for ( const QString& parameterName : paramSet )
|
for ( const QString& parameterName : paramSet )
|
||||||
{
|
|
||||||
auto ensembleParameter = this->createEnsembleParameter( parameterName );
|
|
||||||
if ( !excludeNoVariation || ensembleParameter.normalizedStdDeviation() != 0.0 )
|
|
||||||
{
|
{
|
||||||
|
auto ensembleParameter = this->createEnsembleParameter( parameterName );
|
||||||
m_cachedSortedEnsembleParameters.push_back( ensembleParameter );
|
m_cachedSortedEnsembleParameters.push_back( ensembleParameter );
|
||||||
}
|
}
|
||||||
|
RimSummaryCaseCollection::sortByBinnedVariation( m_cachedSortedEnsembleParameters );
|
||||||
}
|
}
|
||||||
RimSummaryCaseCollection::sortByBinnedVariation( m_cachedSortedEnsembleParameters );
|
|
||||||
|
|
||||||
return m_cachedSortedEnsembleParameters;
|
if ( !excludeNoVariation )
|
||||||
|
{
|
||||||
|
return m_cachedSortedEnsembleParameters;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const double epsilon = 1e-9;
|
||||||
|
std::vector<EnsembleParameter> parametersWithVariation;
|
||||||
|
for ( const auto& p : m_cachedSortedEnsembleParameters )
|
||||||
|
{
|
||||||
|
if ( std::abs( p.normalizedStdDeviation() ) > epsilon )
|
||||||
|
{
|
||||||
|
parametersWithVariation.push_back( p );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return parametersWithVariation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -117,7 +117,7 @@ public:
|
|||||||
int ensembleId() const;
|
int ensembleId() const;
|
||||||
bool hasEnsembleParameters() const;
|
bool hasEnsembleParameters() const;
|
||||||
|
|
||||||
const std::vector<EnsembleParameter>& variationSortedEnsembleParameters( bool excludeNoVariation = false ) const;
|
std::vector<EnsembleParameter> variationSortedEnsembleParameters( bool excludeNoVariation = false ) const;
|
||||||
std::vector<std::pair<EnsembleParameter, double>>
|
std::vector<std::pair<EnsembleParameter, double>>
|
||||||
correlationSortedEnsembleParameters( const RifEclipseSummaryAddress& address ) const;
|
correlationSortedEnsembleParameters( const RifEclipseSummaryAddress& address ) const;
|
||||||
std::vector<std::pair<EnsembleParameter, double>>
|
std::vector<std::pair<EnsembleParameter, double>>
|
||||||
|
Loading…
Reference in New Issue
Block a user