* fixed some warning issues during compilation
This commit is contained in:
parent
27d5cbbc3b
commit
ce8f5f692f
5 changed files with 74 additions and 26 deletions
|
|
@ -30,7 +30,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <utils/eoLogger.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* eoFitnessTraits: a traits class to specify
|
* eoFitnessTraits: a traits class to specify
|
||||||
|
|
@ -45,7 +45,7 @@ class eoParetoFitnessTraits
|
||||||
|
|
||||||
static unsigned nObjectives() { return 2; }
|
static unsigned nObjectives() { return 2; }
|
||||||
static double tol() { return 1e-6; }
|
static double tol() { return 1e-6; }
|
||||||
static bool maximizing(int which) { return true; } // by default: all are maximizing
|
static bool maximizing(int which) { (void)which; return true; } // by default: all are maximizing
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -62,10 +62,11 @@ public :
|
||||||
// possible problems
|
// possible problems
|
||||||
if ( nObj && (nObj != _n) ) // was already set to a different value
|
if ( nObj && (nObj != _n) ) // was already set to a different value
|
||||||
{
|
{
|
||||||
std::cout << "WARNING\n";
|
eo::log << eo::warnings;
|
||||||
std::cout << "WARNING : you are changing the number of objectives\n";
|
eo::log << "WARNING\n";
|
||||||
std::cout << "WARNING : Make sure all existing objects are destroyed\n";
|
eo::log << "WARNING : you are changing the number of objectives\n";
|
||||||
std::cout << "WARNING\n";
|
eo::log << "WARNING : Make sure all existing objects are destroyed\n";
|
||||||
|
eo::log << "WARNING\n";
|
||||||
}
|
}
|
||||||
nObj=_n;
|
nObj=_n;
|
||||||
bObj=_b;
|
bObj=_b;
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,11 @@ public:
|
||||||
|
|
||||||
eoDummyRealBoundModifier (){}
|
eoDummyRealBoundModifier (){}
|
||||||
|
|
||||||
void operator() (eoRealBaseVectorBounds & _bnds,unsigned _i){}
|
void operator() (eoRealBaseVectorBounds & _bnds,unsigned _i)
|
||||||
|
{
|
||||||
|
(void)_bnds;
|
||||||
|
(void)_i;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -178,10 +178,15 @@ public:
|
||||||
|
|
||||||
virtual double uniform(eoRng & _rng = eo::rng) const
|
virtual double uniform(eoRng & _rng = eo::rng) const
|
||||||
{
|
{
|
||||||
|
(void)_rng;
|
||||||
|
|
||||||
throw std::logic_error("Trying to generate uniform values in unbounded eoIntBounds");
|
throw std::logic_error("Trying to generate uniform values in unbounded eoIntBounds");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual long int random(eoRng & _rng = eo::rng) const
|
virtual long int random(eoRng & _rng = eo::rng) const
|
||||||
{
|
{
|
||||||
|
(void)_rng;
|
||||||
|
|
||||||
throw std::logic_error("Trying to generate uniform values in unbounded eoIntBounds");
|
throw std::logic_error("Trying to generate uniform values in unbounded eoIntBounds");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -194,6 +199,8 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void readFrom(std::istream& _is)
|
virtual void readFrom(std::istream& _is)
|
||||||
{
|
{
|
||||||
|
(void)_is;
|
||||||
|
|
||||||
throw std::runtime_error("Should not use eoIntBounds::readFrom");
|
throw std::runtime_error("Should not use eoIntBounds::readFrom");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -314,6 +321,8 @@ public :
|
||||||
*/
|
*/
|
||||||
virtual void readFrom(std::istream& _is)
|
virtual void readFrom(std::istream& _is)
|
||||||
{
|
{
|
||||||
|
(void)_is;
|
||||||
|
|
||||||
throw std::runtime_error("Should not use eoIntInterval::readFrom");
|
throw std::runtime_error("Should not use eoIntInterval::readFrom");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -366,10 +375,15 @@ public :
|
||||||
|
|
||||||
virtual double uniform(eoRng & _rng = eo::rng) const
|
virtual double uniform(eoRng & _rng = eo::rng) const
|
||||||
{
|
{
|
||||||
|
(void)_rng;
|
||||||
|
|
||||||
throw std::logic_error("Trying to generate uniform values in eoIntBelowBound");
|
throw std::logic_error("Trying to generate uniform values in eoIntBelowBound");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual long int random(eoRng & _rng = eo::rng) const
|
virtual long int random(eoRng & _rng = eo::rng) const
|
||||||
{
|
{
|
||||||
|
(void)_rng;
|
||||||
|
|
||||||
throw std::logic_error("Trying to generate uniform values in eoIntBelowBound");
|
throw std::logic_error("Trying to generate uniform values in eoIntBelowBound");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -413,6 +427,8 @@ public :
|
||||||
*/
|
*/
|
||||||
virtual void readFrom(std::istream& _is)
|
virtual void readFrom(std::istream& _is)
|
||||||
{
|
{
|
||||||
|
(void)_is;
|
||||||
|
|
||||||
throw std::runtime_error("Should not use eoIntBelowBound::readFrom");
|
throw std::runtime_error("Should not use eoIntBelowBound::readFrom");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -464,10 +480,15 @@ public :
|
||||||
|
|
||||||
virtual double uniform(eoRng & _rng = eo::rng) const
|
virtual double uniform(eoRng & _rng = eo::rng) const
|
||||||
{
|
{
|
||||||
|
(void)_rng;
|
||||||
|
|
||||||
throw std::logic_error("Trying to generate uniform values in eoIntAboveBound");
|
throw std::logic_error("Trying to generate uniform values in eoIntAboveBound");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual long int random(eoRng & _rng = eo::rng) const
|
virtual long int random(eoRng & _rng = eo::rng) const
|
||||||
{
|
{
|
||||||
|
(void)_rng;
|
||||||
|
|
||||||
throw std::logic_error("Trying to generate uniform values in eoIntAboveBound");
|
throw std::logic_error("Trying to generate uniform values in eoIntAboveBound");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -511,6 +532,8 @@ public :
|
||||||
*/
|
*/
|
||||||
virtual void readFrom(std::istream& _is)
|
virtual void readFrom(std::istream& _is)
|
||||||
{
|
{
|
||||||
|
(void)_is;
|
||||||
|
|
||||||
throw std::runtime_error("Should not use eoIntAboveBound::readFrom");
|
throw std::runtime_error("Should not use eoIntAboveBound::readFrom");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -650,12 +673,12 @@ public:
|
||||||
/** random generator of uniform doubles in bounds
|
/** random generator of uniform doubles in bounds
|
||||||
* @std::exception if unbounded
|
* @std::exception if unbounded
|
||||||
*/
|
*/
|
||||||
virtual double uniform(eoRng & _rng = eo::rng) const {return repBound->uniform();}
|
virtual double uniform(eoRng & _rng = eo::rng) const {(void)_rng; return repBound->uniform();}
|
||||||
|
|
||||||
/** random generator of uniform ints in bounds
|
/** random generator of uniform ints in bounds
|
||||||
* @std::exception if unbounded
|
* @std::exception if unbounded
|
||||||
*/
|
*/
|
||||||
virtual long int random(eoRng & _rng = eo::rng) const {return repBound->random();}
|
virtual long int random(eoRng & _rng = eo::rng) const {(void)_rng; return repBound->random();}
|
||||||
|
|
||||||
/** for memory managements - ugly */
|
/** for memory managements - ugly */
|
||||||
virtual eoIntBounds * dup() const {return repBound->dup();}
|
virtual eoIntBounds * dup() const {return repBound->dup();}
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,8 @@ public:
|
||||||
|
|
||||||
virtual double uniform(eoRng & _rng = eo::rng) const
|
virtual double uniform(eoRng & _rng = eo::rng) const
|
||||||
{
|
{
|
||||||
|
(void)_rng;
|
||||||
|
|
||||||
throw std::logic_error("Trying to generate uniform values in unbounded eoRealBounds");
|
throw std::logic_error("Trying to generate uniform values in unbounded eoRealBounds");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -170,6 +172,8 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void readFrom(std::istream& _is)
|
virtual void readFrom(std::istream& _is)
|
||||||
{
|
{
|
||||||
|
(void)_is;
|
||||||
|
|
||||||
throw std::runtime_error("Should not use eoRealBounds::readFrom");
|
throw std::runtime_error("Should not use eoRealBounds::readFrom");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -285,6 +289,8 @@ public :
|
||||||
*/
|
*/
|
||||||
virtual void readFrom(std::istream& _is)
|
virtual void readFrom(std::istream& _is)
|
||||||
{
|
{
|
||||||
|
(void)_is;
|
||||||
|
|
||||||
throw std::runtime_error("Should not use eoRealInterval::readFrom");
|
throw std::runtime_error("Should not use eoRealInterval::readFrom");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -338,6 +344,8 @@ public :
|
||||||
// random generators
|
// random generators
|
||||||
virtual double uniform(eoRng & _rng = eo::rng) const
|
virtual double uniform(eoRng & _rng = eo::rng) const
|
||||||
{
|
{
|
||||||
|
(void)_rng;
|
||||||
|
|
||||||
throw std::logic_error("Trying to generate uniform values in eoRealBelowBound");
|
throw std::logic_error("Trying to generate uniform values in eoRealBelowBound");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -381,6 +389,8 @@ public :
|
||||||
*/
|
*/
|
||||||
virtual void readFrom(std::istream& _is)
|
virtual void readFrom(std::istream& _is)
|
||||||
{
|
{
|
||||||
|
(void)_is;
|
||||||
|
|
||||||
throw std::runtime_error("Should not use eoRealBelowBound::readFrom");
|
throw std::runtime_error("Should not use eoRealBelowBound::readFrom");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -433,6 +443,8 @@ public :
|
||||||
// random generators
|
// random generators
|
||||||
virtual double uniform(eoRng & _rng = eo::rng) const
|
virtual double uniform(eoRng & _rng = eo::rng) const
|
||||||
{
|
{
|
||||||
|
(void)_rng;
|
||||||
|
|
||||||
throw std::logic_error("Trying to generate uniform values in eoRealAboveBound");
|
throw std::logic_error("Trying to generate uniform values in eoRealAboveBound");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -476,6 +488,8 @@ public :
|
||||||
*/
|
*/
|
||||||
virtual void readFrom(std::istream& _is)
|
virtual void readFrom(std::istream& _is)
|
||||||
{
|
{
|
||||||
|
(void)_is;
|
||||||
|
|
||||||
throw std::runtime_error("Should not use eoRealAboveBound::readFrom");
|
throw std::runtime_error("Should not use eoRealAboveBound::readFrom");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -615,7 +629,7 @@ public:
|
||||||
/** random generator of uniform numbers in bounds
|
/** random generator of uniform numbers in bounds
|
||||||
* @std::exception if unbounded
|
* @std::exception if unbounded
|
||||||
*/
|
*/
|
||||||
virtual double uniform(eoRng & _rng = eo::rng) const {return repBound->uniform();}
|
virtual double uniform(eoRng & _rng = eo::rng) const {(void)_rng; return repBound->uniform();}
|
||||||
|
|
||||||
/** for memory managements - ugly */
|
/** for memory managements - ugly */
|
||||||
virtual eoRealBounds * dup() const {return repBound->dup();}
|
virtual eoRealBounds * dup() const {return repBound->dup();}
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,8 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual double uniform(unsigned _i, eoRng & _rng = eo::rng)
|
virtual double uniform(unsigned _i, eoRng & _rng = eo::rng)
|
||||||
{
|
{
|
||||||
|
(void)_rng;
|
||||||
|
|
||||||
double r= (*this)[_i]->uniform();
|
double r= (*this)[_i]->uniform();
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
@ -403,12 +405,16 @@ public:
|
||||||
// random generators
|
// random generators
|
||||||
virtual double uniform(unsigned, eoRng & _rng = eo::rng)
|
virtual double uniform(unsigned, eoRng & _rng = eo::rng)
|
||||||
{
|
{
|
||||||
|
(void)_rng;
|
||||||
|
|
||||||
throw std::logic_error("No uniform distribution on eoRealVectorNoBounds");
|
throw std::logic_error("No uniform distribution on eoRealVectorNoBounds");
|
||||||
}
|
}
|
||||||
|
|
||||||
// fills a std::vector with uniformly chosen variables in bounds
|
// fills a std::vector with uniformly chosen variables in bounds
|
||||||
void uniform(std::vector<double> &, eoRng & _rng = eo::rng)
|
void uniform(std::vector<double> &, eoRng & _rng = eo::rng)
|
||||||
{
|
{
|
||||||
|
(void)_rng;
|
||||||
|
|
||||||
throw std::logic_error("No uniform distribution on eoRealVectorNoBounds");
|
throw std::logic_error("No uniform distribution on eoRealVectorNoBounds");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue