mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
7834 cref removal (#7917)
* #7834 Well Log Statistics: prefer std::shared_ptr to cvf::ref. * #7834 Use std::map to avoid hard-coded array length.
This commit is contained in:
committed by
GitHub
parent
414ee77aa8
commit
6547ef1525
@@ -162,7 +162,8 @@ void RimEnsembleWellLogStatistics::calculate( const std::vector<RimWellLogFile*>
|
||||
void RimEnsembleWellLogStatistics::calculateByKLayer( const std::vector<RimWellLogFile*>& wellLogFiles,
|
||||
const QString& wellLogChannelName )
|
||||
{
|
||||
cvf::ref<RigWellLogIndexDepthOffset> offsets = RimEnsembleWellLogStatistics::calculateIndexDepthOffset( wellLogFiles );
|
||||
std::shared_ptr<RigWellLogIndexDepthOffset> offsets =
|
||||
RimEnsembleWellLogStatistics::calculateIndexDepthOffset( wellLogFiles );
|
||||
|
||||
std::map<int, std::vector<double>> topValues;
|
||||
std::map<int, std::vector<double>> bottomValues;
|
||||
@@ -251,15 +252,14 @@ void RimEnsembleWellLogStatistics::calculateByKLayer( const std::vector<RimWellL
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigWellLogIndexDepthOffset>
|
||||
std::shared_ptr<RigWellLogIndexDepthOffset>
|
||||
RimEnsembleWellLogStatistics::calculateIndexDepthOffset( const std::vector<RimWellLogFile*>& wellLogFiles )
|
||||
{
|
||||
int hack = 1000;
|
||||
std::vector<double> sumTopDepths( hack, 0.0 );
|
||||
std::vector<int> numTopDepths( hack, 0 );
|
||||
std::map<int, double> sumTopDepths;
|
||||
std::map<int, int> numTopDepths;
|
||||
|
||||
std::vector<double> sumBottomDepths( hack, 0.0 );
|
||||
std::vector<int> numBottomDepths( hack, 0 );
|
||||
std::map<int, double> sumBottomDepths;
|
||||
std::map<int, int> numBottomDepths;
|
||||
|
||||
int minLayerK = std::numeric_limits<int>::max();
|
||||
int maxLayerK = -std::numeric_limits<int>::max();
|
||||
@@ -326,7 +326,7 @@ cvf::ref<RigWellLogIndexDepthOffset>
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
cvf::ref<RigWellLogIndexDepthOffset> offset = cvf::make_ref<RigWellLogIndexDepthOffset>();
|
||||
std::shared_ptr<RigWellLogIndexDepthOffset> offset = std::make_shared<RigWellLogIndexDepthOffset>();
|
||||
for ( int kLayer = minLayerK; kLayer <= maxLayerK; kLayer++ )
|
||||
{
|
||||
if ( numTopDepths[kLayer] > 0 && numBottomDepths[kLayer] > 0 )
|
||||
|
||||
Reference in New Issue
Block a user