* whitespace cleanup

This commit is contained in:
Caner Candan 2011-05-05 17:15:10 +02:00
commit 70e60a50d2
195 changed files with 1763 additions and 1873 deletions

View file

@ -10,23 +10,23 @@ INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src/utils)
### 2) Specify where CMake can find the libraries
######################################################################################
IF(NOT WIN32 OR CYGWIN)
IF(NOT WIN32 OR CYGWIN)
LINK_DIRECTORIES(${EO_BINARY_DIR}/lib)
ENDIF(NOT WIN32 OR CYGWIN)
# especially for Visual Studio
IF(WIN32 AND NOT CYGWIN)
IF(WIN32 AND NOT CYGWIN)
LINK_DIRECTORIES(${EO_BINARY_DIR}\\lib\\${CMAKE_BUILD_TYPE})
ENDIF(WIN32 AND NOT CYGWIN)
ENDIF(WIN32 AND NOT CYGWIN)
######################################################################################
### 3) Define your targets
######################################################################################
# no matter what is the OS, hopefully
ADD_EXECUTABLE(FirstBitGA FirstBitGA.cpp)
ADD_EXECUTABLE(FirstRealGA FirstRealGA.cpp)
ADD_EXECUTABLE(exercise1.3 exercise1.3.cpp)
ADD_EXECUTABLE(FirstBitGA FirstBitGA.cpp)
ADD_EXECUTABLE(FirstRealGA FirstRealGA.cpp)
ADD_EXECUTABLE(exercise1.3 exercise1.3.cpp)
ADD_DEPENDENCIES(FirstBitGA ga eo eoutils)
ADD_DEPENDENCIES(FirstRealGA ga eo eoutils)

View file

@ -78,10 +78,10 @@ void main_function(int argc, char **argv)
{
Indi v; // void individual, to be filled
for (unsigned ivar=0; ivar<VEC_SIZE; ivar++)
{
bool r = rng.flip(); // new value, random in {0,1}
v.push_back(r); // append that random value to v
}
{
bool r = rng.flip(); // new value, random in {0,1}
v.push_back(r); // append that random value to v
}
eval(v); // evaluate it
pop.push_back(v); // and put it in the population
}
@ -138,7 +138,7 @@ void main_function(int argc, char **argv)
eoSGA<Indi> gga(select, xover, CROSS_RATE, mutation, MUT_RATE,
eval, continuator);
eval, continuator);
// Apply algo to pop - that's it!
gga(pop);
@ -156,11 +156,11 @@ int main(int argc, char **argv)
try
{
main_function(argc, argv);
main_function(argc, argv);
}
catch(exception& e)
{
cout << "Exception: " << e.what() << '\n';
cout << "Exception: " << e.what() << '\n';
}
return 1;

View file

@ -78,10 +78,10 @@ void main_function(int argc, char **argv)
{
Indi v; // void individual, to be filled
for (unsigned ivar=0; ivar<VEC_SIZE; ivar++)
{
double r = 2*rng.uniform() - 1; // new value, random in [-1,1)
v.push_back(r); // append that random value to v
}
{
double r = 2*rng.uniform() - 1; // new value, random in [-1,1)
v.push_back(r); // append that random value to v
}
eval(v); // evaluate it
pop.push_back(v); // and put it in the population
}
@ -133,7 +133,7 @@ void main_function(int argc, char **argv)
eoSGA<Indi> gga(select, xover, CROSS_RATE, mutation, MUT_RATE,
eval, continuator);
eval, continuator);
// Apply algo to pop - that's it!
gga(pop);
@ -151,11 +151,11 @@ int main(int argc, char **argv)
{
try
{
main_function(argc, argv);
main_function(argc, argv);
}
catch(exception& e)
{
cout << "Exception: " << e.what() << '\n';
cout << "Exception: " << e.what() << '\n';
}
return 1;

View file

@ -5,11 +5,11 @@ DIR_EO = ../../src
.SUFFIXES: .cpp
# Warning: $(CXX) in Linux (RedHat and Mandrake at least) is g++
# However, if you are using this Makefile within xemacs,
# However, if you are using this Makefile within xemacs,
# and have problems with the interpretation of the output (and its colors)
# then you should use c++ instead (make CXX=c++ will do)
.cpp: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -pg -o $@ $*.cpp $(DIR_EO)/utils/libeoutils.a $(DIR_EO)/libeo.a
.cpp: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -pg -o $@ $*.cpp $(DIR_EO)/utils/libeoutils.a $(DIR_EO)/libeo.a
.cpp.o: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -c -pg $*.cpp
@ -21,5 +21,5 @@ lesson1 : $(firstGA)
all : $(ALL)
clean :
clean :
@/bin/rm $(ALL) *.o *~

View file

@ -18,7 +18,7 @@
//-----------------------------------------------------------------------------
// Include the corresponding file
#include <ga.h> // bitstring representation & operators
#include <ga.h> // bitstring representation & operators
// define your individuals
typedef eoBit<double> Indi; // A bitstring with fitness double
@ -151,11 +151,11 @@ int main(int argc, char **argv)
try
{
main_function(argc, argv);
main_function(argc, argv);
}
catch(exception& e)
{
cout << "Exception: " << e.what() << '\n';
cout << "Exception: " << e.what() << '\n';
}
return 1;