Remove unnecessary tests.

This commit is contained in:
kuepper 2006-12-02 11:02:13 +00:00
commit 3eba6b962c
4 changed files with 62 additions and 64 deletions

View file

@ -1,3 +1,7 @@
2006-12-02 Jochen Küpper <jochen@fhi-berlin.mpg.de>
* configure.in: Remove unnecessary tests.
2006-11-16 Jochen Küpper <jochen@fhi-berlin.mpg.de>
* configure.in (AC_DEBUG): add test

View file

@ -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

View file

@ -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 <string> // std::string
#include <utils/eoRNG.h>
#include "../contrib/MGE/eoVirus.h"
#include "eoVirus.h"
/** VirusBitFlip --> changes 1 bit
*/
@ -42,10 +42,10 @@ class VirusBitFlip: public eoMonOp<eoVirus<FitT> > {
/// 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<FitT>& _chrom) {
unsigned i = eo::rng.random(_chrom.size());
_chrom.virusBitSet(i, _chrom.virusBit(i) ? false : true );
@ -53,71 +53,72 @@ class VirusBitFlip: public eoMonOp<eoVirus<FitT> > {
}
};
template<class FitT>
class VirusMutation: public eoMonOp<eoVirus<FitT> > {
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<FitT>& _chrom) {
/** Change one bit.
@param chrom The cromosome which one bit is going to be changed.
*/
bool operator()(eoVirus<FitT>& _chrom) {
// Search for virus bits
std::vector<unsigned> 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 FitT>
class VirusShiftMutation: public eoMonOp<eoVirus<FitT> > {
public:
class VirusShiftMutation: public eoMonOp<eoVirus<FitT> >
{
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<FitT>& _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<FitT>& _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;
}
};

View file

@ -6,7 +6,6 @@
#
CXX = g++
CXXFLAGS = -DHAVE_SSTREAM
CPPFLAGS = -Wall -O2 #-g #-O2
LDFLAGS =
COMPILE = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c