Updated to use gcc-3.2
This commit is contained in:
parent
fc1113aad6
commit
ff2968bd60
8 changed files with 21 additions and 19 deletions
|
|
@ -34,5 +34,5 @@ AC_TYPE_SIZE_T
|
||||||
dnl Checks for library functions.
|
dnl Checks for library functions.
|
||||||
AC_CHECK_FUNCS(select)
|
AC_CHECK_FUNCS(select)
|
||||||
|
|
||||||
AC_OUTPUT(src/obsolete/Makefile doc/Makefile src/Makefile src/utils/Makefile src/other/Makefile win/Makefile src/gp/Makefile src/es/Makefile src/ga/Makefile test/Makefile contrib/Makefile Makefile app/Makefile app/gprop/Makefile app/mastermind/Makefile app/gpsymreg/Makefile)
|
AC_OUTPUT(src/obsolete/Makefile doc/Makefile src/Makefile src/utils/Makefile src/other/Makefile win/Makefile src/gp/Makefile src/es/Makefile src/ga/Makefile src/do/Makefile test/Makefile contrib/Makefile Makefile app/Makefile app/gprop/Makefile app/mastermind/Makefile app/gpsymreg/Makefile)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@
|
||||||
#ifndef eoParseTree_h
|
#ifndef eoParseTree_h
|
||||||
#define eoParseTree_h
|
#define eoParseTree_h
|
||||||
|
|
||||||
|
#include <iterator>
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#include <EO.h>
|
#include <EO.h>
|
||||||
|
|
@ -54,7 +56,7 @@ class eoParseTree : public EO<FType>, public parse_tree<Node>
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
|
|
||||||
typedef parse_tree<Node>::subtree Subtree;
|
typedef typename parse_tree<Node>::subtree Subtree;
|
||||||
|
|
||||||
/* For Compatibility with the intel C++ compiler for Linux 5.x */
|
/* For Compatibility with the intel C++ compiler for Linux 5.x */
|
||||||
typedef Node reference;
|
typedef Node reference;
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ class eoParseTreeDepthInit : public eoInit< eoParseTree<FType, Node> >
|
||||||
{
|
{
|
||||||
if (last_terminal == -1)
|
if (last_terminal == -1)
|
||||||
{ // check where the last terminal in the sequence resides
|
{ // check where the last terminal in the sequence resides
|
||||||
vector<Node>::iterator it;
|
typename vector<Node>::iterator it;
|
||||||
for (it = initializor.begin(); it != initializor.end(); ++it)
|
for (it = initializor.begin(); it != initializor.end(); ++it)
|
||||||
{
|
{
|
||||||
if (it->arity() > 0)
|
if (it->arity() > 0)
|
||||||
|
|
@ -133,12 +133,12 @@ class eoParseTreeDepthInit : public eoInit< eoParseTree<FType, Node> >
|
||||||
|
|
||||||
if (the_max == 1)
|
if (the_max == 1)
|
||||||
{ // generate terminals only
|
{ // generate terminals only
|
||||||
vector<Node>::iterator it = initializor.begin() + rng.random(last_terminal);
|
typename vector<Node>::iterator it = initializor.begin() + rng.random(last_terminal);
|
||||||
sequence.push_front(*it);
|
sequence.push_front(*it);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<Node>::iterator what_it;
|
typename vector<Node>::iterator what_it;
|
||||||
|
|
||||||
if (grow)
|
if (grow)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ public:
|
||||||
int i = rng.random(_eo1.size());
|
int i = rng.random(_eo1.size());
|
||||||
int j = rng.random(_eo2.size());
|
int j = rng.random(_eo2.size());
|
||||||
|
|
||||||
parse_tree<Node>::subtree tmp = _eo1[i];
|
typename parse_tree<Node>::subtree tmp = _eo1[i];
|
||||||
_eo1[i] = _eo2[j]; // insert subtree
|
_eo1[i] = _eo2[j]; // insert subtree
|
||||||
_eo2[j] = tmp;
|
_eo2[j] = tmp;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -282,7 +282,7 @@ public :
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class RetVal, class It>
|
template <class RetVal, class It>
|
||||||
void apply_mem_func(RetVal& v, It misc, void (T::* f)(RetVal&, subtree::iterator, It))
|
void apply_mem_func(RetVal& v, It misc, void (T::* f)(RetVal&, typename subtree::iterator, It))
|
||||||
{
|
{
|
||||||
(content->*f)(v, begin(), misc);
|
(content->*f)(v, begin(), misc);
|
||||||
}
|
}
|
||||||
|
|
@ -618,7 +618,7 @@ private :
|
||||||
{ _root.apply(v, varValues); }
|
{ _root.apply(v, varValues); }
|
||||||
|
|
||||||
template <class RetVal, class It>
|
template <class RetVal, class It>
|
||||||
void apply_mem_func(RetVal& v, It misc, void (T::* f)(RetVal&, subtree::iterator, It))
|
void apply_mem_func(RetVal& v, It misc, void (T::* f)(RetVal&, typename subtree::iterator, It))
|
||||||
{
|
{
|
||||||
_root.apply_mem_func(v, misc, f);
|
_root.apply_mem_func(v, misc, f);
|
||||||
}
|
}
|
||||||
|
|
@ -689,7 +689,7 @@ private :
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
// else
|
// else
|
||||||
subtree::iterator it;
|
typename subtree::iterator it;
|
||||||
for (it = parent->begin(); it != parent->end(); ++it)
|
for (it = parent->begin(); it != parent->end(); ++it)
|
||||||
{
|
{
|
||||||
if (node == &(*it))
|
if (node == &(*it))
|
||||||
|
|
@ -779,7 +779,7 @@ private :
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
// else
|
// else
|
||||||
subtree::const_iterator it;
|
typename subtree::const_iterator it;
|
||||||
|
|
||||||
for (it = parent->begin(); it != parent->end(); ++it)
|
for (it = parent->begin(); it != parent->end(); ++it)
|
||||||
{
|
{
|
||||||
|
|
@ -888,7 +888,7 @@ private :
|
||||||
|
|
||||||
_root = t;
|
_root = t;
|
||||||
|
|
||||||
for (subtree::iterator it = _root.begin(); it != _root.end(); it++)
|
for (typename subtree::iterator it = _root.begin(); it != _root.end(); it++)
|
||||||
{
|
{
|
||||||
*it = pushed.back();
|
*it = pushed.back();
|
||||||
pushed.pop_back();
|
pushed.pop_back();
|
||||||
|
|
@ -940,25 +940,25 @@ namespace std
|
||||||
{ // for use with stlport on MSVC
|
{ // for use with stlport on MSVC
|
||||||
|
|
||||||
template <class T> inline
|
template <class T> inline
|
||||||
std::forward_iterator_tag iterator_category(gp_parse_tree::parse_tree<T>::embedded_iterator)
|
std::forward_iterator_tag iterator_category(typename gp_parse_tree::parse_tree<T>::embedded_iterator)
|
||||||
{
|
{
|
||||||
return std::forward_iterator_tag();
|
return std::forward_iterator_tag();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T> inline
|
template <class T> inline
|
||||||
ptrdiff_t* distance_type(gp_parse_tree::parse_tree<T>::embedded_iterator)
|
ptrdiff_t* distance_type(typename gp_parse_tree::parse_tree<T>::embedded_iterator)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T> inline
|
template <class T> inline
|
||||||
std::forward_iterator_tag iterator_category(gp_parse_tree::parse_tree<T>::iterator)
|
std::forward_iterator_tag iterator_category(typename gp_parse_tree::parse_tree<T>::iterator)
|
||||||
{
|
{
|
||||||
return std::forward_iterator_tag();
|
return std::forward_iterator_tag();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T> inline
|
template <class T> inline
|
||||||
ptrdiff_t* distance_type(gp_parse_tree::parse_tree<T>::iterator)
|
ptrdiff_t* distance_type(typename gp_parse_tree::parse_tree<T>::iterator)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ public :
|
||||||
is >> repValue;
|
is >> repValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private :
|
//private :
|
||||||
ValueType repValue;
|
ValueType repValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ void the_main(int argc, char* argv[])
|
||||||
|
|
||||||
#if !defined(NO_GNUPLOT)
|
#if !defined(NO_GNUPLOT)
|
||||||
eoGnuplot1DSnapshot snapshot("pareto");
|
eoGnuplot1DSnapshot snapshot("pareto");
|
||||||
snapshot.pointSize =3;
|
//snapshot.with(eoGnuplot::Points(3));
|
||||||
|
|
||||||
cp.add(snapshot);
|
cp.add(snapshot);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,10 +140,10 @@ eoValueParam<unsigned> tournamentSizeParam = parser.createParam(unsigned(2), "to
|
||||||
parentsOrg[i].fitness(i);
|
parentsOrg[i].fitness(i);
|
||||||
else if (fitnessType == string("exp"))
|
else if (fitnessType == string("exp"))
|
||||||
for (unsigned i=0; i<pSize; i++)
|
for (unsigned i=0; i<pSize; i++)
|
||||||
parentsOrg[i].fitness(exp(i));
|
parentsOrg[i].fitness(exp((double)i));
|
||||||
else if (fitnessType == string("log"))
|
else if (fitnessType == string("log"))
|
||||||
for (unsigned i=0; i<pSize; i++)
|
for (unsigned i=0; i<pSize; i++)
|
||||||
parentsOrg[i].fitness(log(i+1));
|
parentsOrg[i].fitness(log(i+1.));
|
||||||
else if (fitnessType == string("super"))
|
else if (fitnessType == string("super"))
|
||||||
{
|
{
|
||||||
for (unsigned i=0; i<pSize-1; i++)
|
for (unsigned i=0; i<pSize-1; i++)
|
||||||
|
|
|
||||||
Reference in a new issue