diff --git a/eo/ChangeLog b/eo/ChangeLog index 8a0e8ee90..4bb7a1ae4 100644 --- a/eo/ChangeLog +++ b/eo/ChangeLog @@ -1,3 +1,7 @@ +2006-12-02 Jochen Küpper + + * configure.in: Remove unnecessary tests. + 2006-11-16 Jochen Küpper * configure.in (AC_DEBUG): add test diff --git a/eo/configure.in b/eo/configure.in index 9db4b1fe4..9e4c451b2 100644 --- a/eo/configure.in +++ b/eo/configure.in @@ -30,18 +30,12 @@ AC_CHECK_PROGS([DOXYGEN], [doxygen], [true]) dnl Checks for header files. AC_LANG(C++) AC_HEADER_STDC -AC_CHECK_HEADERS(limits, [], AC_MSG_ERROR([Need limits C++ include.])) -AC_CHECK_HEADERS(sstream, [], AC_MSG_ERROR([Need sstream C++ include.])) -AC_CHECK_HEADERS(stdint.h, [], AC_MSG_WARN([Need C99 standard header.])) dnl Checks for typedefs, structures, and compiler characteristics. -AC_CHECK_SIZEOF(unsigned long) AC_CHECK_TYPES(uint32_t, [], AC_MSG_WARN([Need uint32_t from C99 standard.])) AC_TYPE_SIZE_T -dnl Checks for libraries. - -dnl Checks for library functions. +dnl Checks for libraries and library functions. AC_CHECK_LIB(m, cos) dnl user-switches diff --git a/eo/contrib/MGE/VirusOp.h b/eo/contrib/MGE/VirusOp.h index 5d8459c46..d6d44caa5 100644 --- a/eo/contrib/MGE/VirusOp.h +++ b/eo/contrib/MGE/VirusOp.h @@ -16,9 +16,9 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Contact: todos@geneura.ugr.es, http://geneura.ugr.es - Marc.Schoenauer@polytechnique.fr -CVS Info: $Date: 2003-02-27 19:26:43 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/contrib/MGE/VirusOp.h,v 1.3 2003-02-27 19:26:43 okoenig Exp $ $Author: okoenig $ + Contact: eodev-main@lists.sourceforge.net + old contact: todos@geneura.ugr.es, http://geneura.ugr.es + Marc.Schoenauer@polytechnique.fr */ #ifndef VirusOp_h @@ -31,7 +31,7 @@ CVS Info: $Date: 2003-02-27 19:26:43 $ $Header: /home/nojhan/dev/eodev/eodev_cvs #include // std::string #include -#include "../contrib/MGE/eoVirus.h" +#include "eoVirus.h" /** VirusBitFlip --> changes 1 bit */ @@ -42,10 +42,10 @@ class VirusBitFlip: public eoMonOp > { /// The class name. virtual std::string className() const { return "VirusBitFlip"; }; - /** - * Change one bit. - * @param chrom The cromosome which one bit is going to be changed. - */ + /** Change one bit. + + @param chrom The cromosome which one bit is going to be changed. + */ bool operator()(eoVirus& _chrom) { unsigned i = eo::rng.random(_chrom.size()); _chrom.virusBitSet(i, _chrom.virusBit(i) ? false : true ); @@ -53,71 +53,72 @@ class VirusBitFlip: public eoMonOp > { } }; + template class VirusMutation: public eoMonOp > { - public: - /// The class name. - virtual std::string className() const { return "VirusMutation"; }; +public: + /// The class name. + virtual std::string className() const { return "VirusMutation"; }; - /** - * Change one bit. - * @param chrom The cromosome which one bit is going to be changed. - */ - bool operator()(eoVirus& _chrom) { + /** Change one bit. + + @param chrom The cromosome which one bit is going to be changed. + */ + bool operator()(eoVirus& _chrom) { // Search for virus bits std::vector bitsSet; for ( unsigned i = 0; i < _chrom.size(); i ++ ) { - if ( _chrom.virusBit(i) ) { + if ( _chrom.virusBit(i) ) { bitsSet.push_back( i ); - } + } } if ( !bitsSet.size() ) { - return false; + return false; } - unsigned flipSite = eo::rng.random(bitsSet.size()); + unsigned flipSite = eo::rng.random(bitsSet.size()); unsigned flipValue = bitsSet[ flipSite ]; _chrom[flipValue] = _chrom[flipValue] ? false : true; return true; - } + } }; + /// Works for 1-bit virus; shifts the one to the right or left template -class VirusShiftMutation: public eoMonOp > { - public: +class VirusShiftMutation: public eoMonOp > +{ +public: - /// Ctor - VirusShiftMutation( ) {}; + /// Ctor + VirusShiftMutation( ) {}; - /// The class name. - virtual std::string className() const { return "VirusShiftMutation"; }; + /// The class name. + virtual std::string className() const { return "VirusShiftMutation"; }; - /** - * Change one bit. - * @param chrom The cromosome which one bit is going to be changed. - */ - bool operator()(eoVirus& _chrom) { - // Search for virus bits - eoBooleanGenerator gen; - for ( unsigned i = 0; i < _chrom.size(); i ++ ) { - if ( _chrom.virusBit(i) ) { - if ( gen() ) { - if ( i + 1 < _chrom.size() ) { - _chrom.virusBitSet(i+1,true); - _chrom.virusBitSet(i, false); - } - } else { - if ( i - 1 > 0 ) { - _chrom.virusBitSet(i-1,true); - _chrom.virusBitSet(i, false); - } - } - } - } - return true; - } + /** Change one bit. - private: + @param chrom The cromosome which one bit is going to be changed. + */ + bool operator()(eoVirus& _chrom) { + // Search for virus bits + eoBooleanGenerator gen; + for ( unsigned i = 0; i < _chrom.size(); i ++ ) { + if ( _chrom.virusBit(i) ) { + if ( gen() ) { + if ( i + 1 < _chrom.size() ) { + _chrom.virusBitSet(i+1,true); + _chrom.virusBitSet(i, false); + } + } else { + if ( i - 1 > 0 ) { + _chrom.virusBitSet(i-1,true); + _chrom.virusBitSet(i, false); + } + } + } + } + return true; + } }; diff --git a/eo/src/pyeo/Makefile b/eo/src/pyeo/Makefile index 5b1f208c3..ef74f8e7b 100644 --- a/eo/src/pyeo/Makefile +++ b/eo/src/pyeo/Makefile @@ -6,7 +6,6 @@ # CXX = g++ -CXXFLAGS = -DHAVE_SSTREAM CPPFLAGS = -Wall -O2 #-g #-O2 LDFLAGS = COMPILE = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c