Clean up configure/build-process.

- assume C++ standard-conforming environment
- add a user-option for gnuplot-support
- separate gnuplot-code into declaration and implementation,
  so we can define at EO-build-time whether to use it or not.

Adopt code and Makefiles to above changes.

Some minor fixes.
This commit is contained in:
kuepper 2005-10-02 21:42:08 +00:00
commit 47af7cfe5a
22 changed files with 603 additions and 537 deletions

View file

@ -10,5 +10,5 @@ LIBEO = $(top_builddir)/src/libeo.a
LIBEOUTILS = $(top_builddir)/src/utils/libeoutils.a
AM_CXXFLAGS = -I$(top_srcdir)/src
DEPS = $(LIBEOUTILS) $(LIBEO)
LIBS = $(LIBEOUTILS) $(LIBEO)
DEPS = $(LIBEO) $(LIBEOUTILS)
LIBS = $(LIBEO) $(LIBEOUTILS)

View file

@ -11,7 +11,7 @@
#include <eoVector.h> // eoVectorLength
#include <eoOp.h> // eoMonOp eoQuadraticOp
#include <eoInit.h> // eoInit
#include <utils/rnd_generators.h> // uniform_generator
#include "utils/rnd_generators.h" // uniform_generator
//-----------------------------------------------------------------------------
// phenotype
@ -50,7 +50,7 @@ phenotype eoChromEvaluator(const Chrom& chrom)
++black;
tmp[i] = -1;
}
// look for whites
for (unsigned i = 0; i < chrom.size(); ++i)
for (unsigned j = 0; j < tmp.size(); ++j)
@ -75,7 +75,7 @@ unsigned num_colors;
void init_eoChromEvaluator(const unsigned& c, const unsigned& l, std::string s)
{
num_colors = c;
// check consistency between parameters
if (s != default_solution)
{
@ -85,14 +85,14 @@ void init_eoChromEvaluator(const unsigned& c, const unsigned& l, std::string s)
std::cerr << "solution length != length" << std::endl;
exit(EXIT_FAILURE);
}
// check number of colors
if (c != default_colors && c < *max_element(s.begin(), s.end()) - '0')
if ((c != default_colors) && (c < unsigned(*max_element(s.begin(), s.end()) - '0')))
{
std::cerr << "too high color number found!" << std::endl;
exit(EXIT_FAILURE);
}
}
}
else
if (l != default_length || c != default_colors )
// generate a random solution
@ -102,7 +102,7 @@ void init_eoChromEvaluator(const unsigned& c, const unsigned& l, std::string s)
s.resize(l);
generate(s.begin(), s.end(), color);
}
// put the solution parameter on the solution chromosome
if (num_colors <= 10)
{