Skip to content

Commit 76f2e3b

Browse files
committed
Typographic fixes
Reducing warnings by removing deprecated function usage Reducing warnings by matching override function types (typedef/const) Correcting shared/static CMake mistake
1 parent f4dbba3 commit 76f2e3b

File tree

27 files changed

+546
-544
lines changed

27 files changed

+546
-544
lines changed

GRT/ClassificationModules/ANBC/ANBC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ VectorFloat ANBC::getNullRejectionThresholds() const{
549549
return nullRejectionThresholds;
550550
}
551551

552-
bool ANBC::setNullRejectionCoeff(Float nullRejectionCoeff){
552+
bool ANBC::setNullRejectionCoeff(const Float nullRejectionCoeff){
553553

554554
if( nullRejectionCoeff > 0 ){
555555
this->nullRejectionCoeff = nullRejectionCoeff;

GRT/ClassificationModules/ANBC/ANBC.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,17 +165,17 @@ class GRT_API ANBC : public Classifier
165165
//Setters
166166
/**
167167
Sets the nullRejectionCoeff parameter.
168-
The nullRejectionCoeff parameter is a multipler controlling the null rejection threshold for each class.
168+
The nullRejectionCoeff parameter is a multiplier controlling the null rejection threshold for each class.
169169
This function will also recompute the null rejection thresholds.
170170
171171
@return returns true if the gamma parameter was updated successfully, false otherwise
172172
*/
173-
bool setNullRejectionCoeff(double nullRejectionCoeff);
173+
virtual bool setNullRejectionCoeff(const Float nullRejectionCoeff);
174174

175175
/**
176176
Sets the weights for the training and prediction.
177177
The dimensionality of the weights should match that of the training data used to train the ANBC models.
178-
The weights should be encapsualted into a LabelledClassificationData container, with one training sample for each class.
178+
The weights should be encapsulated into a LabelledClassificationData container, with one training sample for each class.
179179
180180
@return returns true if the weights were correctly set, false otherwise
181181
*/

GRT/ClassificationModules/AdaBoost/AdaBoost.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ bool AdaBoost::recomputeNullRejectionThresholds(){
441441
return false;
442442
}
443443

444-
bool AdaBoost::setNullRejectionCoeff(Float nullRejectionCoeff){
444+
bool AdaBoost::setNullRejectionCoeff(const Float nullRejectionCoeff){
445445

446446
if( nullRejectionCoeff > 0 ){
447447
this->nullRejectionCoeff = nullRejectionCoeff;

GRT/ClassificationModules/AdaBoost/AdaBoost.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ class GRT_API AdaBoost : public Classifier
153153

154154
/**
155155
Sets the nullRejectionCoeff parameter.
156-
The nullRejectionCoeff parameter is a multipler controlling the null rejection threshold for each class.
156+
The nullRejectionCoeff parameter is a multiplier controlling the null rejection threshold for each class.
157157
This function will also recompute the null rejection thresholds.
158158
159159
@return returns true if the gamma parameter was updated successfully, false otherwise
160160
*/
161-
bool setNullRejectionCoeff(Float nullRejectionCoeff);
161+
virtual bool setNullRejectionCoeff(const Float nullRejectionCoeff);
162162

163163
/**
164164
Sets the WeakClassifier to use for boosting.

GRT/ClassificationModules/KNN/KNN.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ bool KNN::enableBestKValueSearch(bool searchForBestKValue){
754754
return true;
755755
}
756756

757-
bool KNN::setNullRejectionCoeff(Float nullRejectionCoeff){
757+
bool KNN::setNullRejectionCoeff(const Float nullRejectionCoeff){
758758
if( nullRejectionCoeff > 0 ){
759759
this->nullRejectionCoeff = nullRejectionCoeff;
760760
recomputeNullRejectionThresholds();

GRT/ClassificationModules/KNN/KNN.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class GRT_API KNN : public Classifier
204204
205205
@return returns true if the nullRejectionCoeff parameter was updated successfully, false otherwise
206206
*/
207-
bool setNullRejectionCoeff(Float nullRejectionCoeff);
207+
virtual bool setNullRejectionCoeff(const Float nullRejectionCoeff);
208208

209209
/**
210210
Sets the current distance method being used to compute the neighest neighbours.

GRT/ClassificationModules/MinDist/MinDist.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ bool MinDist::recomputeNullRejectionThresholds(){
277277
return false;
278278
}
279279

280-
bool MinDist::setNullRejectionCoeff(Float nullRejectionCoeff){
280+
bool MinDist::setNullRejectionCoeff(const Float nullRejectionCoeff){
281281

282282
if( nullRejectionCoeff > 0 ){
283283
this->nullRejectionCoeff = nullRejectionCoeff;

GRT/ClassificationModules/MinDist/MinDist.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ class GRT_API MinDist : public Classifier
154154
155155
@return returns true if the gamma parameter was updated successfully, false otherwise
156156
*/
157-
virtual bool setNullRejectionCoeff(Float nullRejectionCoeff);
158-
157+
virtual bool setNullRejectionCoeff(const Float nullRejectionCoeff);
158+
159159
/**
160160
Sets the numClusters parameter.
161161
The numClusters parameter sets how many clusters each model will try to find during the training phase.

GRT/ClusteringModules/ClusterTree/ClusterTree.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,11 @@ bool ClusterTree::print() const{
219219
return false;
220220
}
221221

222-
bool ClusterTree::saveModelToFile( std::fstream &file ) const{
222+
bool ClusterTree::save( std::fstream &file ) const{
223223

224224
if( !file.is_open() )
225225
{
226-
errorLog <<"saveModelToFile(fstream &file) - The file is not open!" << std::endl;
226+
errorLog <<"save(fstream &file) - The file is not open!" << std::endl;
227227
return false;
228228
}
229229

@@ -232,7 +232,7 @@ bool ClusterTree::saveModelToFile( std::fstream &file ) const{
232232

233233
//Write the clusterer settings to the file
234234
if( !saveClustererSettingsToFile(file) ){
235-
errorLog <<"saveModelToFile(fstream &file) - Failed to save clusterer settings to file!" << std::endl;
235+
errorLog <<"save(fstream &file) - Failed to save clusterer settings to file!" << std::endl;
236236
return false;
237237
}
238238

@@ -247,21 +247,21 @@ bool ClusterTree::saveModelToFile( std::fstream &file ) const{
247247
if( tree != NULL ){
248248
file << "Tree:\n";
249249
if( !tree->save( file ) ){
250-
errorLog << "saveModelToFile(fstream &file) - Failed to save tree to file!" << std::endl;
250+
errorLog << "save(fstream &file) - Failed to save tree to file!" << std::endl;
251251
return false;
252252
}
253253
}
254254

255255
return true;
256256
}
257257

258-
bool ClusterTree::loadModelFromFile( std::fstream &file ){
258+
bool ClusterTree::load( std::fstream &file ){
259259

260260
clear();
261261

262262
if(!file.is_open())
263263
{
264-
errorLog << "loadModelFromFile(string filename) - Could not open file to load model" << std::endl;
264+
errorLog << "load(string filename) - Could not open file to load model" << std::endl;
265265
return false;
266266
}
267267

@@ -270,47 +270,47 @@ bool ClusterTree::loadModelFromFile( std::fstream &file ){
270270
//Find the file type header
271271
file >> word;
272272
if(word != "GRT_CLUSTER_TREE_MODEL_FILE_V1.0"){
273-
errorLog << "loadModelFromFile(string filename) - Could not find Model File Header" << std::endl;
273+
errorLog << "load(string filename) - Could not find Model File Header" << std::endl;
274274
return false;
275275
}
276276

277277
//Load the base settings from the file
278278
if( !loadClustererSettingsFromFile(file) ){
279-
errorLog << "loadModelFromFile(string filename) - Failed to load base settings from file!" << std::endl;
279+
errorLog << "load(string filename) - Failed to load base settings from file!" << std::endl;
280280
return false;
281281
}
282282

283283
file >> word;
284284
if(word != "NumSplittingSteps:"){
285-
errorLog << "loadModelFromFile(string filename) - Could not find the NumSplittingSteps!" << std::endl;
285+
errorLog << "load(string filename) - Could not find the NumSplittingSteps!" << std::endl;
286286
return false;
287287
}
288288
file >> numSplittingSteps;
289289

290290
file >> word;
291291
if(word != "MinNumSamplesPerNode:"){
292-
errorLog << "loadModelFromFile(string filename) - Could not find the MinNumSamplesPerNode!" << std::endl;
292+
errorLog << "load(string filename) - Could not find the MinNumSamplesPerNode!" << std::endl;
293293
return false;
294294
}
295295
file >> minNumSamplesPerNode;
296296

297297
file >> word;
298298
if(word != "MaxDepth:"){
299-
errorLog << "loadModelFromFile(string filename) - Could not find the MaxDepth!" << std::endl;
299+
errorLog << "load(string filename) - Could not find the MaxDepth!" << std::endl;
300300
return false;
301301
}
302302
file >> maxDepth;
303303

304304
file >> word;
305305
if(word != "RemoveFeaturesAtEachSpilt:"){
306-
errorLog << "loadModelFromFile(string filename) - Could not find the RemoveFeaturesAtEachSpilt!" << std::endl;
306+
errorLog << "load(string filename) - Could not find the RemoveFeaturesAtEachSpilt!" << std::endl;
307307
return false;
308308
}
309309
file >> removeFeaturesAtEachSplit;
310310

311311
file >> word;
312312
if(word != "TrainingMode:"){
313-
errorLog << "loadModelFromFile(string filename) - Could not find the TrainingMode!" << std::endl;
313+
errorLog << "load(string filename) - Could not find the TrainingMode!" << std::endl;
314314
return false;
315315
}
316316
UINT tempTrainingMode = 0;
@@ -319,22 +319,22 @@ bool ClusterTree::loadModelFromFile( std::fstream &file ){
319319

320320
file >> word;
321321
if(word != "MinRMSErrorPerNode:"){
322-
errorLog << "loadModelFromFile(string filename) - Could not find the MinRMSErrorPerNode!" << std::endl;
322+
errorLog << "load(string filename) - Could not find the MinRMSErrorPerNode!" << std::endl;
323323
return false;
324324
}
325325
file >> minRMSErrorPerNode;
326326

327327
file >> word;
328328
if(word != "TreeBuilt:"){
329-
errorLog << "loadModelFromFile(string filename) - Could not find the TreeBuilt!" << std::endl;
329+
errorLog << "load(string filename) - Could not find the TreeBuilt!" << std::endl;
330330
return false;
331331
}
332332
file >> trained;
333333

334334
if( trained ){
335335
file >> word;
336336
if(word != "Tree:"){
337-
errorLog << "loadModelFromFile(string filename) - Could not find the Tree!" << std::endl;
337+
errorLog << "load(string filename) - Could not find the Tree!" << std::endl;
338338
return false;
339339
}
340340

@@ -343,14 +343,14 @@ bool ClusterTree::loadModelFromFile( std::fstream &file ){
343343

344344
if( tree == NULL ){
345345
clear();
346-
errorLog << "loadModelFromFile(fstream &file) - Failed to create new RegressionTreeNode!" << std::endl;
346+
errorLog << "load(fstream &file) - Failed to create new RegressionTreeNode!" << std::endl;
347347
return false;
348348
}
349349

350350
tree->setParent( NULL );
351351
if( !tree->load( file ) ){
352352
clear();
353-
errorLog << "loadModelFromFile(fstream &file) - Failed to load tree from file!" << std::endl;
353+
errorLog << "load(fstream &file) - Failed to load tree from file!" << std::endl;
354354
return false;
355355
}
356356

GRT/ClusteringModules/ClusterTree/ClusterTree.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ class GRT_API ClusterTree : public Clusterer
7878
It clones the data from the Base Class Clusterer pointer into this instance
7979
8080
@param cluster: a pointer to the Clusterer Base Class, this should be pointing to another ClusterTree instance
81-
@return returns true if the clone was successfull, false otherwise
81+
@return returns true if the clone was successful, false otherwise
8282
*/
8383
virtual bool deepCopyFrom(const Clusterer *cluster) override;
8484

8585
/**
86-
This trains the ClusterTree model, using the labelled regression data.
86+
This trains the ClusterTree model, using the labeled regression data.
8787
This overrides the train function in the ML base class.
8888
8989
@param trainingData: a reference to the training data
@@ -104,7 +104,7 @@ class GRT_API ClusterTree : public Clusterer
104104
This overrides the clear function in the Regressifier base class.
105105
It will completely clear the ML module, removing any trained model and setting all the base variables to their default values.
106106
107-
@return returns true if the module was cleared succesfully, false otherwise
107+
@return returns true if the module was cleared successfully, false otherwise
108108
*/
109109
virtual bool clear() override;
110110

@@ -122,7 +122,7 @@ class GRT_API ClusterTree : public Clusterer
122122
@param file: a reference to the file the model will be saved to
123123
@return returns true if the model was saved successfully, false otherwise
124124
*/
125-
virtual bool saveModelToFile( std::fstream &file ) const override;
125+
virtual bool save( std::fstream &file ) const override;
126126

127127
/**
128128
This loads a trained model from a file.
@@ -131,7 +131,7 @@ class GRT_API ClusterTree : public Clusterer
131131
@param file: a reference to the file the model will be loaded from
132132
@return returns true if the model was loaded successfully, false otherwise
133133
*/
134-
virtual bool loadModelFromFile( std::fstream &file ) override;
134+
virtual bool load( std::fstream &file ) override;
135135

136136
/**
137137
Deep copies the tree, returning a pointer to the new clusterer tree.
@@ -173,12 +173,12 @@ class GRT_API ClusterTree : public Clusterer
173173
Tree::TrainingMode getTrainingMode() const;
174174

175175
/**
176-
Gets the number of steps that will be used to search for the best spliting value for each node.
176+
Gets the number of steps that will be used to search for the best splitting value for each node.
177177
178178
If the trainingMode is set to BEST_ITERATIVE_SPILT, then the numSplittingSteps controls how many iterative steps there will be per feature.
179179
If the trainingMode is set to BEST_RANDOM_SPLIT, then the numSplittingSteps controls how many random searches there will be per feature.
180180
181-
@return returns the number of steps that will be used to search for the best spliting value for each node
181+
@return returns the number of steps that will be used to search for the best splitting value for each node
182182
*/
183183
UINT getNumSplittingSteps() const;
184184

GRT/ClusteringModules/GaussianMixtureModels/GaussianMixtureModels.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -310,17 +310,17 @@ bool GaussianMixtureModels::predict_(VectorFloat &x){
310310
return true;
311311
}
312312

313-
bool GaussianMixtureModels::saveModelToFile( std::fstream &file ) const{
313+
bool GaussianMixtureModels::save( std::fstream &file ) const{
314314

315315
if( !file.is_open() ){
316-
errorLog << "saveModelToFile(string filename) - Failed to open file!" << std::endl;
316+
errorLog << "save(string filename) - Failed to open file!" << std::endl;
317317
return false;
318318
}
319319

320320
file << "GRT_GAUSSIAN_MIXTURE_MODELS_FILE_V1.0\n";
321321

322322
if( !saveClustererSettingsToFile( file ) ){
323-
errorLog << "saveModelToFile(fstream &file) - Failed to save cluster settings to file!" << std::endl;
323+
errorLog << "save(fstream &file) - Failed to save cluster settings to file!" << std::endl;
324324
return false;
325325
}
326326

@@ -363,7 +363,7 @@ bool GaussianMixtureModels::saveModelToFile( std::fstream &file ) const{
363363

364364
}
365365

366-
bool GaussianMixtureModels::loadModelFromFile( std::fstream &file ){
366+
bool GaussianMixtureModels::load( std::fstream &file ){
367367

368368
//Clear any previous model
369369
clear();
@@ -375,7 +375,7 @@ bool GaussianMixtureModels::loadModelFromFile( std::fstream &file ){
375375
}
376376

377377
if( !loadClustererSettingsFromFile( file ) ){
378-
errorLog << "loadModelFromFile(fstream &file) - Failed to load cluster settings from file!" << std::endl;
378+
errorLog << "load(fstream &file) - Failed to load cluster settings from file!" << std::endl;
379379
return false;
380380
}
381381

@@ -392,7 +392,7 @@ bool GaussianMixtureModels::loadModelFromFile( std::fstream &file ){
392392
file >> word;
393393
if( word != "Mu:" ){
394394
clear();
395-
errorLog << "loadModelFromFile(fstream &file) - Failed to load Mu!" << std::endl;
395+
errorLog << "load(fstream &file) - Failed to load Mu!" << std::endl;
396396
return false;
397397
}
398398
for(UINT k=0; k<numClusters; k++){
@@ -405,7 +405,7 @@ bool GaussianMixtureModels::loadModelFromFile( std::fstream &file ){
405405
file >> word;
406406
if( word != "Sigma:" ){
407407
clear();
408-
errorLog << "loadModelFromFile(fstream &file) - Failed to load Sigma!" << std::endl;
408+
errorLog << "load(fstream &file) - Failed to load Sigma!" << std::endl;
409409
return false;
410410
}
411411
for(UINT k=0; k<numClusters; k++){
@@ -421,7 +421,7 @@ bool GaussianMixtureModels::loadModelFromFile( std::fstream &file ){
421421
file >> word;
422422
if( word != "InvSigma:" ){
423423
clear();
424-
errorLog << "loadModelFromFile(fstream &file) - Failed to load InvSigma!" << std::endl;
424+
errorLog << "load(fstream &file) - Failed to load InvSigma!" << std::endl;
425425
return false;
426426
}
427427
for(UINT k=0; k<numClusters; k++){
@@ -437,7 +437,7 @@ bool GaussianMixtureModels::loadModelFromFile( std::fstream &file ){
437437
file >> word;
438438
if( word != "Det:" ){
439439
clear();
440-
errorLog << "loadModelFromFile(fstream &file) - Failed to load Det!" << std::endl;
440+
errorLog << "load(fstream &file) - Failed to load Det!" << std::endl;
441441
return false;
442442
}
443443
for(UINT k=0; k<numClusters; k++){

GRT/ClusteringModules/GaussianMixtureModels/GaussianMixtureModels.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class GRT_API GaussianMixtureModels : public Clusterer
120120
@param fstream &file: a reference to the file the GaussianMixtureModels model will be saved to
121121
@return returns true if the model was saved successfully, false otherwise
122122
*/
123-
virtual bool saveModelToFile( std::fstream &file ) const;
123+
virtual bool save( std::fstream &file ) const;
124124

125125
/**
126126
This loads a trained GaussianMixtureModels model from a file.
@@ -129,7 +129,7 @@ class GRT_API GaussianMixtureModels : public Clusterer
129129
@param fstream &file: a reference to the file the GaussianMixtureModels model will be loaded from
130130
@return returns true if the model was loaded successfully, false otherwise
131131
*/
132-
virtual bool loadModelFromFile( std::fstream &file );
132+
virtual bool load( std::fstream &file );
133133

134134
/**
135135
This function returns the mu matrix which is built during the training phase.

0 commit comments

Comments
 (0)