From 3ccfd743782fbb7ae2342967b327216c1265c310 Mon Sep 17 00:00:00 2001
From: Ludovic Hussonnois <ludovic.hussonnois@c-s.fr>
Date: Tue, 18 Apr 2017 16:42:57 +0200
Subject: [PATCH] REFAC: Use boost::make_shared

---
 .../AppClassification/app/otbComputeConfusionMatrix.cxx     | 2 +-
 .../AppClassification/app/otbTrainVectorClassifier.cxx      | 2 +-
 Modules/Learning/Unsupervised/include/otbContingencyTable.h | 2 +-
 .../include/otbSharkKMeansMachineLearningModel.txx          | 6 +++---
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Modules/Applications/AppClassification/app/otbComputeConfusionMatrix.cxx b/Modules/Applications/AppClassification/app/otbComputeConfusionMatrix.cxx
index 410fe23752..5da72f363a 100644
--- a/Modules/Applications/AppClassification/app/otbComputeConfusionMatrix.cxx
+++ b/Modules/Applications/AppClassification/app/otbComputeConfusionMatrix.cxx
@@ -217,7 +217,7 @@ private:
   {
     std::ofstream outFile;
     outFile.open( this->GetParameterString( "out" ).c_str() );
-    outFile << contingencyTable->ToCsv();
+    outFile << contingencyTable->ToCSV();
     outFile.close();
   }
 
diff --git a/Modules/Applications/AppClassification/app/otbTrainVectorClassifier.cxx b/Modules/Applications/AppClassification/app/otbTrainVectorClassifier.cxx
index e65d49ae9e..5d9d3b8975 100644
--- a/Modules/Applications/AppClassification/app/otbTrainVectorClassifier.cxx
+++ b/Modules/Applications/AppClassification/app/otbTrainVectorClassifier.cxx
@@ -113,7 +113,7 @@ protected:
       // Write contingency table
       std::ofstream outFile;
       outFile.open( this->GetParameterString( "io.confmatout" ).c_str() );
-      outFile << table->ToCsv();
+      outFile << table->ToCSV();
       }
   }
 
diff --git a/Modules/Learning/Unsupervised/include/otbContingencyTable.h b/Modules/Learning/Unsupervised/include/otbContingencyTable.h
index e1facdfa44..f9e3c9317d 100644
--- a/Modules/Learning/Unsupervised/include/otbContingencyTable.h
+++ b/Modules/Learning/Unsupervised/include/otbContingencyTable.h
@@ -105,7 +105,7 @@ public:
     return o;
   }
 
-  std::string ToCsv() const
+  std::string ToCSV() const
   {
     const char separator = ',';
 
diff --git a/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.txx b/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.txx
index 267a676ae6..96c12ae86d 100644
--- a/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.txx
+++ b/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.txx
@@ -54,7 +54,7 @@ SharkKMeansMachineLearningModel<TInputValue, TOutputValue>
         m_Normalized( false ), m_K(2), m_MaximumNumberOfIterations( 10 )
 {
   // Default set HardClusteringModel
-  m_ClusteringModel = boost::shared_ptr<ClusteringModelType>(new ClusteringModelType( &m_Centroids ));
+  m_ClusteringModel = boost::make_shared<ClusteringModelType>( &m_Centroids );
 }
 
 
@@ -81,7 +81,7 @@ SharkKMeansMachineLearningModel<TInputValue, TOutputValue>
 
   // Use a Hard Clustering Model for classification
   shark::kMeans( data, m_K, m_Centroids, m_MaximumNumberOfIterations );
-  m_ClusteringModel = boost::shared_ptr<ClusteringModelType>(new ClusteringModelType( &m_Centroids ));
+  m_ClusteringModel = boost::make_shared<ClusteringModelType>( &m_Centroids );
 }
 
 template<class TInputValue, class TOutputValue>
@@ -153,7 +153,7 @@ SharkKMeansMachineLearningModel<TInputValue, TOutputValue>
   shark::Data<ClusteringOutputType> clusters;
   try
     {
-     clusters = ( *m_ClusteringModel )( inputSamples );
+    clusters = ( *m_ClusteringModel )( inputSamples );
     }
   catch( ... )
     {
-- 
GitLab