diff --git a/Modules/Applications/AppClassification/app/otbComputeConfusionMatrix.cxx b/Modules/Applications/AppClassification/app/otbComputeConfusionMatrix.cxx index 410fe23752ec0262837e8384e02c01b535d669db..5da72f363a6adcdc97d2c28977a6e345bc94d57e 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 e65d49ae9e7e83bc805b02e647e20eb7ec3658d6..5d9d3b897594cbd962b0c6b5763c18f21f0f75c4 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 e1facdfa44d73f7107596e5fffe092538858b499..f9e3c9317d790429287ab1ffcb76300b6db2f942 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 267a676ae668a863928be6087146a1ca7dd61d6e..96c12ae86d937877f640b5f9524a40bce87b441a 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( ... ) {