diff --git a/edo/application/cmaes/main.cpp b/edo/application/cmaes/main.cpp index 47a09f998..fbdccaa61 100644 --- a/edo/application/cmaes/main.cpp +++ b/edo/application/cmaes/main.cpp @@ -84,7 +84,7 @@ int main(int ac, char** av) eoPop< RealVec >& pop = do_make_pop(parser, state, *init); // (2) First evaluation before starting the research algorithm - apply(eval, pop); + ::apply(eval, pop); // Prepare bounder class to set bounds of sampling. // This is used by edoSampler. diff --git a/edo/application/eda/main.cpp b/edo/application/eda/main.cpp index 6b0311fe0..eb36d1d56 100644 --- a/edo/application/eda/main.cpp +++ b/edo/application/eda/main.cpp @@ -87,7 +87,7 @@ int main(int ac, char** av) eoPop< EOT >& pop = do_make_pop(parser, state, *init); // (2) First evaluation before starting the research algorithm - apply(eval, pop); + ::apply(eval, pop); // Prepare bounder class to set bounds of sampling. // This is used by edoSampler. diff --git a/edo/src/edoDistribReset.h b/edo/src/edoDistribReset.h index 4b826d4f1..dd97e0423 100644 --- a/edo/src/edoDistribReset.h +++ b/edo/src/edoDistribReset.h @@ -52,7 +52,7 @@ class edoDistribReset : public eoAlgoReset _distrib(distrib) { } - virtual void operator()( eoPop& pop ) + virtual void operator()( eoPop& /*pop*/ ) { if(_has_dim) { _distrib.reset(_dim); diff --git a/eo/doc/eo.doxyfile.cmake b/eo/doc/eo.doxyfile.cmake index e781ed5f6..934114d8f 100644 --- a/eo/doc/eo.doxyfile.cmake +++ b/eo/doc/eo.doxyfile.cmake @@ -1339,7 +1339,7 @@ HIDE_UNDOC_RELATIONS = YES # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) -HAVE_DOT = NO +HAVE_DOT = YES # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This diff --git a/eo/src/eoInitializer.h b/eo/src/eoInitializer.h index 3349768b2..02bbe4068 100644 --- a/eo/src/eoInitializer.h +++ b/eo/src/eoInitializer.h @@ -105,10 +105,10 @@ public: virtual void operator() () { eoPop empty_pop; - apply(proc, pop); + ::apply(proc, pop); procPara(empty_pop, pop); - apply < POT > (initVelo, pop); - apply < POT > (initBest, pop); + ::apply < POT > (initVelo, pop); + ::apply < POT > (initBest, pop); topology.setup(pop); } diff --git a/eo/src/eoTopology.h b/eo/src/eoTopology.h index 08ded01a1..4ae8f57c0 100644 --- a/eo/src/eoTopology.h +++ b/eo/src/eoTopology.h @@ -80,7 +80,7 @@ public: /** * Prints the neighborhoods contained in the topology. */ - virtual void printOn() = 0; + // virtual void printOn() = 0; // Already defined in eoPop }; diff --git a/eo/src/utils/eoFileMonitor.cpp b/eo/src/utils/eoFileMonitor.cpp index d504305a8..8486a4c78 100644 --- a/eo/src/utils/eoFileMonitor.cpp +++ b/eo/src/utils/eoFileMonitor.cpp @@ -12,7 +12,7 @@ #include "eoParam.h" #include "../eoExceptions.h" -using namespace std; +// using namespace std; void eoFileMonitor::printHeader(std::ostream& os) { @@ -33,7 +33,7 @@ void eoFileMonitor::printHeader(std::ostream& os) void eoFileMonitor::printHeader() { // create file - ofstream os(filename.c_str()); + std::ofstream os(filename.c_str()); if (!os) { @@ -46,11 +46,11 @@ void eoFileMonitor::printHeader() eoMonitor& eoFileMonitor::operator()(void) { - ofstream os(filename.c_str(), + std::ofstream os(filename.c_str(), overwrite ? - ios_base::out|ios_base::trunc // truncate + std::ios_base::out|std::ios_base::trunc // truncate : - ios_base::out|ios_base::app // append + std::ios_base::out|std::ios_base::app // append ); if (!os) diff --git a/eo/src/utils/eoIntBounds.cpp b/eo/src/utils/eoIntBounds.cpp index a3c790956..d6a495015 100644 --- a/eo/src/utils/eoIntBounds.cpp +++ b/eo/src/utils/eoIntBounds.cpp @@ -81,7 +81,7 @@ eoIntBounds* eoGeneralIntBounds::getBoundsFromString(std::string _value) } // now create the embedded eoIntBounds object - eoIntBounds * locBound; + eoIntBounds * locBound = nullptr; if (minBounded && maxBounded) { if (maxBound <= minBound) diff --git a/eo/src/utils/eoParser.cpp b/eo/src/utils/eoParser.cpp index 48194f740..a7c3c185b 100644 --- a/eo/src/utils/eoParser.cpp +++ b/eo/src/utils/eoParser.cpp @@ -42,7 +42,7 @@ Authors: #include "eoLogger.h" -using namespace std; +// using namespace std; std::ostream& printSectionHeader(std::ostream& os, std::string section) { @@ -76,8 +76,8 @@ eoParameterLoader::~eoParameterLoader() } } -eoParser::eoParser ( unsigned _argc, char **_argv , string _programDescription, - string /*_lFileParamName*/, char /*_shortHand*/) : +eoParser::eoParser ( unsigned _argc, char **_argv , std::string _programDescription, + std::string /*_lFileParamName*/, char /*_shortHand*/) : programName(_argv[0]), programDescription( _programDescription), needHelpMessage( false ), @@ -92,11 +92,11 @@ eoParser::eoParser ( unsigned _argc, char **_argv , string _programDescription, if(_argv[i][0] == '@') { // read response file char *pts = _argv[i]+1; // yes a char*, sorry :-) - ifstream ifs (pts); + std::ifstream ifs (pts); ifs.peek(); // check if it exists if (!ifs) { - // string msg = string("Could not open response file: ") + pts; + // std::string msg = std::string("Could not open response file: ") + pts; throw eoFileError(pts); } // read - will be overwritten by command-line @@ -105,7 +105,7 @@ eoParser::eoParser ( unsigned _argc, char **_argv , string _programDescription, } } // now read arguments on command-line - stringstream stream; + std::stringstream stream; for (i = 1; i < _argc; ++i) { stream << _argv[i] << '\n'; @@ -159,24 +159,24 @@ void eoParser::doRegisterParam(eoParam& param) { if (param.required() && !isItThere(param)) { - string msg = "Required parameter: " + param.longName() + " missing"; + std::string msg = "Required parameter: " + param.longName() + " missing"; needHelpMessage = true; messages.push_back(msg); } - pair value = getValue(param); + std::pair value = getValue(param); if (value.first) { param.setValue(value.second); } } -pair eoParser::getValue(eoParam& _param) const +std::pair eoParser::getValue(eoParam& _param) const { - pair result(false, ""); + std::pair result(false, ""); if (_param.shortName() != 0) { - map::const_iterator it = shortNameMap.find(_param.shortName()); + std::map::const_iterator it = shortNameMap.find(_param.shortName()); if (it != shortNameMap.end()) { result.second = it->second; @@ -184,7 +184,7 @@ pair eoParser::getValue(eoParam& _param) const return result; } } - map::const_iterator it = longNameMap.find(_param.longName()); + std::map::const_iterator it = longNameMap.find(_param.longName()); if (it != longNameMap.end()) { result.second = it->second; @@ -205,21 +205,21 @@ void eoParser::updateParameters() } } -void eoParser::readFrom(istream& is) +void eoParser::readFrom(std::istream& is) { - string str; + std::string str; // we must avoid processing \section{xxx} if xxx is NOT "Parser" bool processing = true; while (is >> str) { - if (str.find(string("\\section{"))==0) // found section begin - processing = (str.find(string("Parser"))= 2) { if (str[2] == '=') { if (str.size() >= 3) - value = string(str.begin() + 3, str.end()); + value = std::string(str.begin() + 3, str.end()); } else { - value = string(str.begin() + 2, str.end()); + value = std::string(str.begin() + 2, str.end()); } } @@ -274,7 +274,7 @@ void eoParser::readFrom(istream& is) updateParameters(); } -void eoParser::printOn(ostream& os) const +void eoParser::printOn(std::ostream& os) const { typedef MultiMapType::const_iterator It; @@ -299,12 +299,12 @@ void eoParser::printOn(ostream& os) const if (!isItThere(*param)) // comment out the ones not set by the user os << "# "; - string str = "--" + param->longName() + "=" + param->getValue(); + std::string str = "--" + param->longName() + "=" + param->getValue(); - os.setf(ios_base::left, ios_base::adjustfield); - os << setfill(' ') << setw(40) << str; + os.setf(std::ios_base::left, std::ios_base::adjustfield); + os << std::setfill(' ') << std::setw(40) << str; - os << setw(0) << " # "; + os << std::setw(0) << " # "; if (param->shortName()) os << '-' << param->shortName() << " : "; os << param->description(); @@ -318,11 +318,11 @@ void eoParser::printOn(ostream& os) const } } -void eoParser::printHelp(ostream& os) +void eoParser::printHelp(std::ostream& os) { if (needHelp.value() == false && !messages.empty()) { - std::copy(messages.begin(), messages.end(), ostream_iterator(os, "\n")); + std::copy(messages.begin(), messages.end(), std::ostream_iterator(os, "\n")); messages.clear(); return; } @@ -333,9 +333,9 @@ void eoParser::printHelp(ostream& os) // print the usage when calling the program from the command line os << "Usage: "<< programName<<" [Options]\n"; // only short usage! - os << "Options of the form \"-f[=Value]\" or \"--Name[=value]\"" << endl; + os << "Options of the form \"-f[=Value]\" or \"--Name[=value]\"" << std::endl; - os << "Where:"<first; + std::string entry = lIt->first; MultiMapType::const_iterator it; @@ -397,7 +397,7 @@ bool eoParser::userNeedsHelp(void) if (it == params.end()) { - string msg = "Unknown parameter: --" + entry + " entered"; + std::string msg = "Unknown parameter: --" + entry + " entered"; needHelpMessage = true; messages.push_back(msg); } @@ -420,15 +420,15 @@ bool eoParser::userNeedsHelp(void) if (it == params.end()) { - string entryString(1, entry); - string msg = "Unknown parameter: -" + entryString + " entered"; + std::string entryString(1, entry); + std::string msg = "Unknown parameter: -" + entryString + " entered"; needHelpMessage = true; messages.push_back(msg); } } // for sIt if( needHelpMessage ) { - string msg = "Use -h or --help to get help about available parameters"; + std::string msg = "Use -h or --help to get help about available parameters"; messages.push_back( msg ); } @@ -438,13 +438,13 @@ bool eoParser::userNeedsHelp(void) } ///////////////// I put these here at the moment -ostream & operator<<(ostream & _os, const eoParamParamType & _rate) +std::ostream & operator<<(std::ostream & _os, const eoParamParamType & _rate) { _rate.printOn(_os); return _os; } -istream & operator>>(istream & _is, eoParamParamType & _rate) +std::istream & operator>>(std::istream & _is, eoParamParamType & _rate) { _rate.readFrom(_is); return _is; diff --git a/eo/src/utils/eoState.cpp b/eo/src/utils/eoState.cpp index 0b70f533a..8359c65d9 100644 --- a/eo/src/utils/eoState.cpp +++ b/eo/src/utils/eoState.cpp @@ -14,31 +14,31 @@ #include "../eoObject.h" #include "../eoPersistent.h" -using namespace std; +// using namespace std; -void eoState::removeComment(string& str, string comment) +void eoState::removeComment(std::string& str, std::string comment) { - string::size_type pos = str.find(comment); + std::string::size_type pos = str.find(comment); - if (pos != string::npos) + if (pos != std::string::npos) { str.erase(pos, str.size()); } } -bool eoState::is_section(const string& str, string& name) +bool eoState::is_section(const std::string& str, std::string& name) { - string::size_type pos = str.find(_tag_section_so); + std::string::size_type pos = str.find(_tag_section_so); - if (pos == string::npos) + if (pos == std::string::npos) return false; //else - string::size_type end = str.find(_tag_section_sc); + std::string::size_type end = str.find(_tag_section_sc); - if (end == string::npos) + if (end == std::string::npos) return false; // else @@ -59,9 +59,9 @@ eoState::~eoState(void) void eoState::registerObject(eoPersistent& registrant) { - string name = createObjectName(dynamic_cast(®istrant)); + std::string name = createObjectName(dynamic_cast(®istrant)); - pair res = objectMap.insert(make_pair(name, ®istrant)); + std::pair res = objectMap.insert(make_pair(name, ®istrant)); if (res.second == true) { @@ -73,13 +73,13 @@ void eoState::registerObject(eoPersistent& registrant) } } -void eoState::load(const string& _filename) +void eoState::load(const std::string& _filename) { - ifstream is (_filename.c_str()); + std::ifstream is (_filename.c_str()); if (!is) { - // string str = "Could not open file " + _filename; + // std::string str = "Could not open file " + _filename; throw eoFileError(_filename); } @@ -89,14 +89,14 @@ void eoState::load(const string& _filename) // FIXME implement parsing and loading of other formats void eoState::load(std::istream& is) { - string str; - string name; + std::string str; + std::string name; getline(is, str); if (is.fail()) { - // string str = "Error while reading stream"; + // std::string str = "Error while reading stream"; throw eoFileError("stream"); } @@ -104,7 +104,7 @@ void eoState::load(std::istream& is) { // parse section header if (is_section(str, name)) { - string fullString; + std::string fullString; ObjectMap::iterator it = objectMap.find(name); if (it == objectMap.end()) @@ -122,7 +122,7 @@ void eoState::load(std::istream& is) // now we have the object, get lines, remove comments etc. - string fullstring; + std::string fullstring; while (getline(is, str)) { @@ -134,7 +134,7 @@ void eoState::load(std::istream& is) removeComment(str, getCommentString()); fullstring += str + "\n"; } - istringstream the_stream(fullstring); + std::istringstream the_stream(fullstring); object->readFrom(the_stream); } } @@ -148,13 +148,13 @@ void eoState::load(std::istream& is) } -void eoState::save(const string& filename) const +void eoState::save(const std::string& filename) const { // saves in order of insertion - ofstream os(filename.c_str()); + std::ofstream os(filename.c_str()); if (!os) { - // string msg = "Could not open file: " + filename + " for writing!"; + // std::string msg = "Could not open file: " + filename + " for writing!"; throw eoFileError(filename); } @@ -163,7 +163,7 @@ void eoState::save(const string& filename) const //void eoState::save(std::ostream& os) const //{ // saves in order of insertion -// for (vector::const_iterator it = creationOrder.begin(); it != creationOrder.end(); ++it) +// for (std::vector::const_iterator it = creationOrder.begin(); it != creationOrder.end(); ++it) // { // os << "\\section{" << (*it)->first << "}\n"; // (*it)->second->printOn(os); @@ -171,7 +171,7 @@ void eoState::save(const string& filename) const // } //} -void eoState::saveSection( std::ostream& os, vector::const_iterator it) const +void eoState::saveSection( std::ostream& os, std::vector::const_iterator it) const { os << _tag_section_so << (*it)->first << _tag_section_sc; @@ -190,7 +190,7 @@ void eoState::save(std::ostream& os) const // save the first section assert( creationOrder.size() > 0 ); // saves in order of insertion - vector::const_iterator it = creationOrder.begin(); + std::vector::const_iterator it = creationOrder.begin(); saveSection(os,it); it++; @@ -204,23 +204,23 @@ void eoState::save(std::ostream& os) const } -string eoState::createObjectName(eoObject* obj) +std::string eoState::createObjectName(eoObject* obj) { if (obj == 0) { - ostringstream os; + std::ostringstream os; os << objectMap.size(); return os.str(); } // else - string name = obj->className(); + std::string name = obj->className(); ObjectMap::const_iterator it = objectMap.find(name); unsigned count = 1; while (it != objectMap.end()) { - ostringstream os; + std::ostringstream os; os << obj->className().c_str() << count++; name = os.str(); it = objectMap.find(name); diff --git a/eo/src/utils/make_help.cpp b/eo/src/utils/make_help.cpp index 26644ea02..b7d5ff766 100644 --- a/eo/src/utils/make_help.cpp +++ b/eo/src/utils/make_help.cpp @@ -32,7 +32,7 @@ #include "eoParser.h" -using namespace std; +// using namespace std; /** Generation of the status file, and output of the help message if needed * @@ -47,24 +47,24 @@ using namespace std; void make_help(eoParser & _parser, bool exit_after) { // name of the "status" file where all actual parameter values will be saved - string str_status = _parser.ProgramName() + ".status"; // default value - eoValueParam& statusParam = _parser.createParam(str_status, "status","Status file",'\0', "Persistence" ); + std::string str_status = _parser.ProgramName() + ".status"; // default value + eoValueParam& statusParam = _parser.createParam(str_status, "status","Status file",'\0', "Persistence" ); // dump status file BEFORE help, so the user gets a chance to use it: // it's probably the case where she/he needs it most!!! // Only help parameter will not be in status file - but who cares??? if (statusParam.value() != "") { - ofstream os(statusParam.value().c_str()); + std::ofstream os(statusParam.value().c_str()); os << _parser; // and you can use that file as parameter file } // do the following AFTER ALL PARAMETERS HAVE BEEN PROCESSED // i.e. in case you need parameters somewhere else, postpone these if (_parser.userNeedsHelp()) { - _parser.printHelp(cout); - cout << "You can use an edited copy of file " << statusParam.value() - << " as parameter file" << endl; + _parser.printHelp(std::cout); + std::cout << "You can use an edited copy of file " << statusParam.value() + << " as parameter file" << std::endl; if(exit_after) { exit(0); } @@ -80,7 +80,7 @@ void make_help(eoParser & _parser, bool exit_after) */ bool testDirRes(std::string _dirName, bool _erase=true) { - string s = "test -d " + _dirName; + std::string s = "test -d " + _dirName; int res = system(s.c_str()); // test for (unlikely) errors if ( (res==-1) || (res==127) ) @@ -91,7 +91,7 @@ bool testDirRes(std::string _dirName, bool _erase=true) // now make sure there is a dir without any file in it - or quit if (res) // no dir present { - s = string("mkdir ")+ _dirName; + s = std::string("mkdir ")+ _dirName; int res = system(s.c_str()); (void)res; return true; @@ -99,7 +99,7 @@ bool testDirRes(std::string _dirName, bool _erase=true) // else if (_erase) // OK to erase { - s = string("/bin/rm ")+ _dirName + "/*"; + s = std::string("/bin/rm ")+ _dirName + "/*"; int res = system(s.c_str()); (void)res; return true; diff --git a/eo/test/t-eoRingTopology.cpp b/eo/test/t-eoRingTopology.cpp index de2824c26..9274114d9 100644 --- a/eo/test/t-eoRingTopology.cpp +++ b/eo/test/t-eoRingTopology.cpp @@ -33,9 +33,9 @@ int main_function(int argc, char **argv) eoFirstIsBestInit < Indi > localInit; eoPop < Indi > pop; pop.append (POP_SIZE, random); - apply(eval, pop); - apply < Indi > (veloRandom, pop); - apply < Indi > (localInit, pop); + ::apply(eval, pop); + ::apply < Indi > (veloRandom, pop); + ::apply < Indi > (localInit, pop); eoRingTopology topology(NEIGHBORHOOD_SIZE); topology.setup(pop); std::cout<<"\n\n\nPopulation :\n\n"< pop; pop.append(pop_size, init); - apply(eval,pop); + ::apply(eval,pop); algo(pop); diff --git a/eo/tutorial/Lesson1/FirstBitGA.cpp b/eo/tutorial/Lesson1/FirstBitGA.cpp index cc187a81e..2f9a9abc2 100644 --- a/eo/tutorial/Lesson1/FirstBitGA.cpp +++ b/eo/tutorial/Lesson1/FirstBitGA.cpp @@ -38,7 +38,7 @@ double binary_value(const Indi & _indi) } // GENERAL //----------------------------------------------------------------------------- -void main_function(int argc, char **argv) +void main_function(int /*argc*/, char **/*argv*/) { // PARAMETRES // all parameters are hard-coded! diff --git a/eo/tutorial/Lesson1/FirstRealGA.cpp b/eo/tutorial/Lesson1/FirstRealGA.cpp index 074c5ae86..9e1b73356 100644 --- a/eo/tutorial/Lesson1/FirstRealGA.cpp +++ b/eo/tutorial/Lesson1/FirstRealGA.cpp @@ -38,7 +38,7 @@ double real_value(const Indi & _indi) } // GENERAL //----------------------------------------------------------------------------- -void main_function(int argc, char **argv) +void main_function(int /*argc*/, char **/*argv*/) { // PARAMETRES // all parameters are hard-coded! diff --git a/eo/tutorial/Lesson1/exercise1.3.cpp b/eo/tutorial/Lesson1/exercise1.3.cpp index 89965d511..ff8baf3dd 100644 --- a/eo/tutorial/Lesson1/exercise1.3.cpp +++ b/eo/tutorial/Lesson1/exercise1.3.cpp @@ -39,7 +39,7 @@ double binary_value(const Indi & _indi) //----------------------------------------------------------------------------- -void main_function(int argc, char **argv) +void main_function(int /*argc*/, char **/*argv*/) { const unsigned int SEED = 42; // seed for random number generator const unsigned int VEC_SIZE = 8; // Number of bits in genotypes diff --git a/eo/tutorial/Lesson2/FirstRealEA.cpp b/eo/tutorial/Lesson2/FirstRealEA.cpp index 2d22e5756..62582da86 100644 --- a/eo/tutorial/Lesson2/FirstRealEA.cpp +++ b/eo/tutorial/Lesson2/FirstRealEA.cpp @@ -36,7 +36,7 @@ using namespace std; // GENERAL //----------------------------------------------------------------------------- -void main_function(int argc, char **argv) +void main_function(int /*argc*/, char **/*argv*/) { // PARAMETRES const unsigned int SEED = 42; // seed for random number generator diff --git a/eo/tutorial/Lesson2/exercise2.3.cpp b/eo/tutorial/Lesson2/exercise2.3.cpp index 0768450db..06dbe023a 100644 --- a/eo/tutorial/Lesson2/exercise2.3.cpp +++ b/eo/tutorial/Lesson2/exercise2.3.cpp @@ -36,7 +36,7 @@ typedef eoBit Indi; // A bitstring with fitness double using namespace std; -void main_function(int argc, char **argv) +void main_function(int /*argc*/, char **/*argv*/) { // PARAMETRES const unsigned int SEED = 42; // seed for random number generator diff --git a/eo/tutorial/Lesson5/eoOneMaxMutation.h b/eo/tutorial/Lesson5/eoOneMaxMutation.h index 42a840fea..3a447ba0b 100644 --- a/eo/tutorial/Lesson5/eoOneMaxMutation.h +++ b/eo/tutorial/Lesson5/eoOneMaxMutation.h @@ -44,7 +44,7 @@ public: * modifies the parent * @param _genotype The parent genotype (will be modified) */ - bool operator()(GenotypeT & _genotype) + bool operator()(GenotypeT & /*_genotype*/) { bool isModified(true); // START code for mutation of the _genotype object diff --git a/eo/tutorial/Lesson5/eoOneMaxQuadCrossover.h b/eo/tutorial/Lesson5/eoOneMaxQuadCrossover.h index b10942157..b20884b86 100644 --- a/eo/tutorial/Lesson5/eoOneMaxQuadCrossover.h +++ b/eo/tutorial/Lesson5/eoOneMaxQuadCrossover.h @@ -46,7 +46,7 @@ public: * @param _genotype1 The first parent * @param _genotype2 The second parent */ - bool operator()(GenotypeT& _genotype1, GenotypeT & _genotype2) + bool operator()(GenotypeT& /*_genotype1*/, GenotypeT & /*_genotype2*/) { bool oneAtLeastIsModified(true); // START code for crossover of _genotype1 and _genotype2 objects diff --git a/eo/tutorial/Lesson5/make_op_OneMax.h b/eo/tutorial/Lesson5/make_op_OneMax.h index d8c5ed853..d6081af29 100644 --- a/eo/tutorial/Lesson5/make_op_OneMax.h +++ b/eo/tutorial/Lesson5/make_op_OneMax.h @@ -73,7 +73,7 @@ */ template -eoGenOp & do_make_op(eoParameterLoader& _parser, eoState& _state, eoInit& _init) +eoGenOp & do_make_op(eoParameterLoader& _parser, eoState& _state, eoInit& /*_init*/) { // this is a temporary version, while Maarten codes the full tree-structured // general operator input diff --git a/eo/tutorial/Lesson6/RealPSO.cpp b/eo/tutorial/Lesson6/RealPSO.cpp index 23f67100f..fa4195128 100644 --- a/eo/tutorial/Lesson6/RealPSO.cpp +++ b/eo/tutorial/Lesson6/RealPSO.cpp @@ -12,7 +12,7 @@ #include // Use functions from namespace std -using namespace std; +// using namespace std; // Do not do this, this shadows EO's `apply` function. //----------------------------------------------------------------------------- typedef eoMinimizingFitness FitT; @@ -33,7 +33,7 @@ FitT real_value (const Particle & _particle) -void main_function(int argc, char **argv) +void main_function(int /*argc*/, char **/*argv*/) { // PARAMETRES // all parameters are hard-coded! @@ -114,9 +114,9 @@ void main_function(int argc, char **argv) pop.sort(); // Print (sorted) the initial population (raw printout) - cout << "INITIAL POPULATION:" << endl; + std::cout << "INITIAL POPULATION:" << std::endl; for (unsigned i = 0; i < pop.size(); ++i) - cout << "\t best fit=" << pop[i] << endl; + std::cout << "\t best fit=" << pop[i] << std::endl; /////////////// @@ -158,9 +158,9 @@ void main_function(int argc, char **argv) // OUTPUT // Print (sorted) intial population pop.sort(); - cout << "FINAL POPULATION:" << endl; + std::clog << "FINAL POPULATION:" << std::endl; for (unsigned i = 0; i < pop.size(); ++i) - cout << "\t best fit=" << pop[i] << endl; + std::clog << "\t best fit=" << pop[i] << std::endl; } @@ -173,9 +173,9 @@ int main(int argc, char **argv) { main_function(argc, argv); } - catch(exception& e) + catch(std::exception& e) { - cout << "Exception: " << e.what() << '\n'; + std::cerr << "Exception: " << e.what() << '\n'; } return 1; diff --git a/moeo/tutorial/examples/flowshop/FlowShopBenchmarkParser.cpp b/moeo/tutorial/examples/flowshop/FlowShopBenchmarkParser.cpp index 68059fc43..7b21f3661 100644 --- a/moeo/tutorial/examples/flowshop/FlowShopBenchmarkParser.cpp +++ b/moeo/tutorial/examples/flowshop/FlowShopBenchmarkParser.cpp @@ -45,25 +45,25 @@ FlowShopBenchmarkParser::FlowShopBenchmarkParser(const std::string _benchmarkFil } -const unsigned int FlowShopBenchmarkParser::getM() +unsigned int FlowShopBenchmarkParser::getM() { return M; } -const unsigned int FlowShopBenchmarkParser::getN() +unsigned int FlowShopBenchmarkParser::getN() { return N; } -const std::vector< std::vector > FlowShopBenchmarkParser::getP() +std::vector< std::vector > FlowShopBenchmarkParser::getP() { return p; } -const std::vector FlowShopBenchmarkParser::getD() +std::vector FlowShopBenchmarkParser::getD() { return d; } diff --git a/moeo/tutorial/examples/flowshop/FlowShopBenchmarkParser.h b/moeo/tutorial/examples/flowshop/FlowShopBenchmarkParser.h index 8805c8b24..88f6538ed 100644 --- a/moeo/tutorial/examples/flowshop/FlowShopBenchmarkParser.h +++ b/moeo/tutorial/examples/flowshop/FlowShopBenchmarkParser.h @@ -60,25 +60,25 @@ class FlowShopBenchmarkParser /** * the number of machines */ - const unsigned int getM(); + unsigned int getM(); /** * the number of jobs */ - const unsigned int getN(); + unsigned int getN(); /** * the processing times */ - const std::vector < std::vector < unsigned int > > getP(); + std::vector < std::vector < unsigned int > > getP(); /** * the due-dates */ - const std::vector < unsigned int > getD(); + std::vector < unsigned int > getD(); /** diff --git a/moeo/tutorial/examples/flowshop/FlowShopObjectiveVectorTraits.cpp b/moeo/tutorial/examples/flowshop/FlowShopObjectiveVectorTraits.cpp index 08487e873..829bfb833 100644 --- a/moeo/tutorial/examples/flowshop/FlowShopObjectiveVectorTraits.cpp +++ b/moeo/tutorial/examples/flowshop/FlowShopObjectiveVectorTraits.cpp @@ -38,13 +38,13 @@ #include -bool FlowShopObjectiveVectorTraits::minimizing (int _i) +bool FlowShopObjectiveVectorTraits::minimizing (int /*_i*/) { // minimizing both return true; } -bool FlowShopObjectiveVectorTraits::maximizing (int _i) +bool FlowShopObjectiveVectorTraits::maximizing (int /*_i*/) { // minimizing both return false;