From a5a1c34a3cb291a89d26ac8bf5a9eb1150d6e879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= <cedric.traizet@c-s.fr> Date: Thu, 18 Apr 2019 17:21:00 +0200 Subject: [PATCH] STY: clang format --- .../app/otbKMeansClassification.cxx | 34 +++++++++---------- .../otbSharkKMeansMachineLearningModel.h | 8 ++--- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx b/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx index aac361024a..a6c69baa5e 100644 --- a/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx +++ b/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx @@ -77,21 +77,22 @@ protected: MandatoryOff("ts"); AddParameter(ParameterType_Int, "maxit", "Maximum number of iterations"); - SetParameterDescription("maxit", "Maximum number of iterations for the learning step." - " If this parameter is set to 0, the KMeans algorithm will not stop until convergence"); + SetParameterDescription("maxit", + "Maximum number of iterations for the learning step." + " If this parameter is set to 0, the KMeans algorithm will not stop until convergence"); SetDefaultParameterInt("maxit", 1000); MandatoryOff("maxit"); - - AddParameter( ParameterType_Group, "centroids", "Centroids IO parameters" ); - SetParameterDescription( "centroids", - "Group of parameters for centroids IO." ); + + AddParameter(ParameterType_Group, "centroids", "Centroids IO parameters"); + SetParameterDescription("centroids", "Group of parameters for centroids IO."); AddParameter(ParameterType_InputFilename, "centroids.in", "input centroids text file"); - SetParameterDescription("centroids.in", "Input text file containing centroid posistions used to initialize the algorithm." - " The file must contain one centroid per line, and each centroid value must be separated by a space. The number of" - " centroids in this file must match the number of classes (nc parameter)."); + SetParameterDescription("centroids.in", + "Input text file containing centroid posistions used to initialize the algorithm." + " The file must contain one centroid per line, and each centroid value must be separated by a space. The number of" + " centroids in this file must match the number of classes (nc parameter)."); MandatoryOff("centroids.in"); - + ShareKMSamplingParameters(); ConnectKMSamplingParams(); } @@ -256,15 +257,14 @@ protected: GetParameterInt("maxit")); GetInternalApplication("training")->SetParameterInt("classifier.sharkkm.k", GetParameterInt("nc")); - if(IsParameterEnabled("centroids.in") && HasValue("centroids.in")) + if (IsParameterEnabled("centroids.in") && HasValue("centroids.in")) { - GetInternalApplication("training")->SetParameterString("classifier.sharkkm.centroids.in", - GetParameterString("centroids.in")); - - GetInternalApplication("training")->SetParameterString("classifier.sharkkm.centroids.stats", - GetInternalApplication("imgstats")->GetParameterString("out")); + GetInternalApplication("training")->SetParameterString("classifier.sharkkm.centroids.in", GetParameterString("centroids.in")); + + GetInternalApplication("training") + ->SetParameterString("classifier.sharkkm.centroids.stats", GetInternalApplication("imgstats")->GetParameterString("out")); } - + if( IsParameterEnabled("rand")) GetInternalApplication("training")->SetParameterInt("rand", GetParameterInt("rand")); diff --git a/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.h b/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.h index 24c0e33c08..6957404377 100644 --- a/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.h +++ b/Modules/Learning/Unsupervised/include/otbSharkKMeansMachineLearningModel.h @@ -126,14 +126,14 @@ public: itkSetMacro( K, unsigned ); /** Initialize the centroids for the kmeans algorithm */ - void SetCentroidsFromData(const shark::Data<shark::RealVector> & data) + void SetCentroidsFromData(const shark::Data<shark::RealVector>& data) { m_Centroids.setCentroids(data); this->Modified(); } - - void ExportCentroids(const std::string & filename); - + + void ExportCentroids(const std::string& filename); + protected: /** Constructor */ SharkKMeansMachineLearningModel(); -- GitLab