Removed "using namespace std" statements from header files in EO -- "std::" identifier were added where necessary.
This commit is contained in:
parent
6441ea1ec3
commit
86fa476c67
263 changed files with 2009 additions and 1976 deletions
|
|
@ -15,6 +15,9 @@
|
|||
#include <eo>
|
||||
#include <ga.h>
|
||||
|
||||
// Use functions from namespace std
|
||||
using namespace std;
|
||||
|
||||
// REPRESENTATION
|
||||
//-----------------------------------------------------------------------------
|
||||
// define your individuals
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@
|
|||
#include <eo>
|
||||
#include <es.h>
|
||||
|
||||
// Use functions from namespace std
|
||||
using namespace std;
|
||||
|
||||
// REPRESENTATION
|
||||
//-----------------------------------------------------------------------------
|
||||
// define your individuals
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@
|
|||
// define your individuals
|
||||
typedef eoBit<double> Indi; // A bitstring with fitness double
|
||||
|
||||
using namespace std;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** a simple fitness function that computes the number of ones of a bitstring
|
||||
@param _indi A biststring individual
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@
|
|||
#include <eo>
|
||||
#include <ga.h>
|
||||
|
||||
// Use functions from namespace std
|
||||
using namespace std;
|
||||
|
||||
// REPRESENTATION
|
||||
//-----------------------------------------------------------------------------
|
||||
// define your individuals
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@
|
|||
// define your individuals
|
||||
typedef eoReal<double> Indi;
|
||||
|
||||
// Use functions from namespace std
|
||||
using namespace std;
|
||||
|
||||
// EVALFUNC
|
||||
//-----------------------------------------------------------------------------
|
||||
// a simple fitness function that computes the euclidian norm of a real vector
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@param _chrom A binary chromosome
|
||||
*/
|
||||
// INIT
|
||||
double binary_value(const vector<bool>& _chrom)
|
||||
double binary_value(const std::vector<bool>& _chrom)
|
||||
{
|
||||
double sum = 0;
|
||||
for (unsigned i = 0; i < _chrom.size(); i++)
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ typedef eoBit<double> Indi; // A bitstring with fitness double
|
|||
// GENERAL
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
using namespace std;
|
||||
|
||||
void main_function(int argc, char **argv)
|
||||
{
|
||||
// PARAMETRES
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@
|
|||
#include <eo>
|
||||
#include <ga.h>
|
||||
|
||||
// Use functions from namespace std
|
||||
using namespace std;
|
||||
|
||||
// EVAL
|
||||
#include "binary_value.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@
|
|||
// define your individuals
|
||||
typedef eoReal<eoMinimizingFitness> Indi;
|
||||
|
||||
// Use functions from namespace std
|
||||
using namespace std;
|
||||
|
||||
// EVALFUNC
|
||||
//-----------------------------------------------------------------------------
|
||||
// a simple fitness function that computes the euclidian norm of a real vector
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@param _chrom A binary chromosome
|
||||
*/
|
||||
// INIT
|
||||
double binary_value(const vector<bool>& _chrom)
|
||||
double binary_value(const std::vector<bool>& _chrom)
|
||||
{
|
||||
double sum = 0;
|
||||
for (unsigned i = 0; i < _chrom.size(); i++)
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@
|
|||
// define your genotype and fitness types
|
||||
typedef eoBit<eoMinimizingFitness> Indi;
|
||||
|
||||
using namespace std;
|
||||
|
||||
// the main_function: nothing changed(!), except variable initialization
|
||||
void main_function(int argc, char **argv)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ typedef eoBit <double> Indi; // A bitstring with fitness double
|
|||
|
||||
#include "binary_value.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
void main_function(int argc, char ** argv) {
|
||||
|
||||
// Some parameters ...
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ typedef eoBit <double> Indi; // A bitstring with fitness double
|
|||
|
||||
#include "binary_value.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
void main_function(int argc, char ** argv) {
|
||||
|
||||
// Some parameters ...
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ typedef eoBit <double> Indi; // A bitstring with fitness double
|
|||
|
||||
#include "binary_value.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
void main_function(int argc, char ** argv) {
|
||||
|
||||
// Some parameters ...
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
@param _chrom A binary chromosome
|
||||
*/
|
||||
// INIT
|
||||
double binary_value(const vector<bool>& _chrom)
|
||||
double binary_value(const std::vector<bool>& _chrom)
|
||||
{
|
||||
double sum = 0;
|
||||
for (unsigned i = 0; i < _chrom.size(); i++)
|
||||
|
|
|
|||
Reference in a new issue