Commit 3ccfd743 authored by Ludovic Hussonnois's avatar Ludovic Hussonnois

REFAC: Use boost::make_shared

parent 77534adc
......@@ -217,7 +217,7 @@ private:
{
std::ofstream outFile;
outFile.open( this->GetParameterString( "out" ).c_str() );
outFile << contingencyTable->ToCsv();
outFile << contingencyTable->ToCSV();
outFile.close();
}
......
......@@ -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();
}
}
......
......@@ -105,7 +105,7 @@ public:
return o;
}
std::string ToCsv() const
std::string ToCSV() const
{
const char separator = ',';
......
......@@ -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( ... )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment