fix: remove a lot of trivial warnings

This commit is contained in:
Johann Dreo 2024-08-23 17:59:49 +02:00
commit 84148824e0
83 changed files with 218 additions and 196 deletions

View file

@ -54,7 +54,11 @@ public:
* @param _maxFullEval number maximum of iterations
* @param _restartCounter if true the counter of number of evaluations restarts to "zero" at initialization, if false, the number is cumulative
*/
moFullEvalContinuator(eoEvalFuncCounter<EOT> & _eval, unsigned int _maxFullEval, bool _restartCounter = true): eval(_eval), maxFullEval(_maxFullEval), restartCounter(_restartCounter) {
moFullEvalContinuator(eoEvalFuncCounter<EOT> & _eval, unsigned int _maxFullEval, bool _restartCounter = true):
eval(_eval),
restartCounter(_restartCounter),
maxFullEval(_maxFullEval)
{
nbEval_start = eval.value();
}

View file

@ -167,7 +167,7 @@ public :
if (nb > 1) {
sd = 0;
for(int i = 0; i < nb; i++)
for(unsigned i = 0; i < nb; i++)
sd += (neighborFitness[i] - mean) * (neighborFitness[i] - mean) ;
sd = sqrt( sd / (nb - 1.0) ); // becareful: could be infinite when large values
//sd = sqrt( (sd - nb * mean * mean) / (nb - 1.0) ); // becareful: could be negative due to approximation of large values

View file

@ -62,7 +62,7 @@ public :
* Set the first and the third quartile of fitness in the neighborhood
* @param _sol the first solution
*/
virtual void init(EOT & _sol) {
virtual void init(EOT & /*_sol*/) {
value().first = nhStat.getQ1();
value().second = nhStat.getQ3();
}
@ -71,7 +71,7 @@ public :
* Set the first and the third quartile fitness in the neighborhood
* @param _sol the corresponding solution
*/
virtual void operator()(EOT & _sol) {
virtual void operator()(EOT & /*_sol*/) {
value().first = nhStat.getQ1();
value().second = nhStat.getQ3();
}

View file

@ -72,7 +72,7 @@ public:
* @param _neighbor the neighbor to assign
* @return a neighbor equal to the other
*/
virtual moNeighbor<EOT, Fitness>& operator=(
moNeighbor<EOT, Fitness>& operator=(
const moNeighbor<EOT, Fitness>& _neighbor) {
if (!(_neighbor.invalid()))
fitness(_neighbor.fitness());
@ -93,7 +93,7 @@ public:
* @param _neighbor a neighbor
* @return if _neighbor and this one are equals
*/
virtual bool equals(moNeighbor<EOT, Fitness> & /*_neighbor*/) {
bool equals(moNeighbor<EOT, Fitness> & /*_neighbor*/) {
return false;
}

View file

@ -112,7 +112,7 @@ private:
nonSig = 0;
unsigned int n = 1;
for(int j = 0; j < nk.K + 1; j++) {
for(unsigned j = 0; j < nk.K + 1; j++) {
if (_solution[ nk.links[i][j] ] == 1)
sig = sig | n;

View file

@ -84,10 +84,10 @@ public:
moEval<Neighbor>& _eval,
unsigned int _nbAdaptWalk) :
moSampling<Neighbor>(initHC, * new moRandomSearch<Neighbor>(initHC, _fullEval, _nbAdaptWalk), copyStat),
neighborEvalCount(_eval),
nEvalStat(neighborEvalCount, true),
copyStat(lengthStat), // copy is used to report the statistic of the first walk
neighborEvalCount(_eval),
nEvalStat(neighborEvalCount, true),
copyEvalStat(nEvalStat),
copyStat(lengthStat), // copy is used to report the statistic of the first walk
checkpoint(trueCont),
hc(_neighborhood, _fullEval, neighborEvalCount, checkpoint),
initHC(_init, hc)
@ -95,15 +95,15 @@ public:
// to count the number of step in the HC
checkpoint.add(lengthStat);
// set the long name of this statistic which is the length of the walk
copyStat.setLongName("length");
// set the long name of this statistic which is the length of the walk
copyStat.setLongName("length");
// to count the number of evaluations
// to count the number of evaluations
checkpoint.add(nEvalStat);
// set the long name of this statistic which is the number of neighbor evaluation
copyEvalStat.setLongName("ngheval");
// set the long name of this statistic which is the number of neighbor evaluation
copyEvalStat.setLongName("ngheval");
// add the solution into statistics
this->add(copyEvalStat);
this->add(solStat);
@ -118,10 +118,10 @@ public:
}
protected:
/* count the number of evaluations */
moEvalCounter<Neighbor> neighborEvalCount;
moValueStat<EOT, unsigned long> nEvalStat;
moStatFromStat<EOT, double> copyEvalStat;
/* count the number of evaluations */
moEvalCounter<Neighbor> neighborEvalCount;
moValueStat<EOT, unsigned long> nEvalStat;
moStatFromStat<EOT, double> copyEvalStat;
moSolutionStat<EOT> solStat;
moMinusOneCounterStat<EOT> lengthStat;

View file

@ -192,9 +192,9 @@ protected:
moSolutionStat<EOT> solutionStat;
moDistanceStat<EOT> distStat;
moNeighborhoodStat< Neighbor > neighborhoodStat;
moMinNeighborStat< Neighbor > minStat;
moAverageFitnessNeighborStat< Neighbor > averageStat;
moStdFitnessNeighborStat< Neighbor > stdStat;
moMinNeighborStat< Neighbor > minStat;
moMaxNeighborStat< Neighbor > maxStat;
moNbSupNeighborStat< Neighbor > nbSupStat;
moNbInfNeighborStat< Neighbor > nbInfStat;