Handle including from contrib/MGE nicely.

This commit is contained in:
kuepper 2005-10-06 17:22:40 +00:00
commit 7c3702f6a6
7 changed files with 145 additions and 124 deletions

View file

@ -1,36 +1,36 @@
/* /* eoVirus.h
eoVirus.h
(c) GeNeura Team 2001, Marc Schoenauer 2000 (c) GeNeura Team 2001, Marc Schoenauer 2000
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or modify
modify it under the terms of the GNU Lesser General Public it under the terms of the GNU Lesser General Public License as
License as published by the Free Software Foundation; either published by the Free Software Foundation; either version 2 of the
version 2 of the License, or (at your option) any later version. License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful, but
but WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
Contact: todos@geneura.ugr.es, http://geneura.ugr.es Contact: todos@geneura.ugr.es, http://geneura.ugr.es
Marc.Schoenauer@polytechnique.fr Marc.Schoenauer@polytechnique.fr
CVS Info: $Date: 2004-12-23 15:29:07 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/contrib/MGE/eoVirus.h,v 1.3 2004-12-23 15:29:07 kuepper Exp $ $Author: kuepper $
*/ */
#ifndef eoVirus_h #ifndef eoVirus_h
#define eoVirus_h #define eoVirus_h
//----------------------------------------------------------------------------- #include <iostream>
#include <functional>
#include <string>
#include <vector>
#include <iostream> // ostream, istream #include "ga/eoBit.h"
#include <functional> // bind2nd
#include <string> // std::string
#include <ga/eoBit.h>
/** /**
\defgroup bitstring \defgroup bitstring
@ -38,10 +38,12 @@ CVS Info: $Date: 2004-12-23 15:29:07 $ $Header: /home/nojhan/dev/eodev/eodev_cvs
Various functions for a bitstring representation Various functions for a bitstring representation
*/ */
/** eoBit: implementation of bitstring chromosome. /** Implementation of bitstring chromosome.
\class eoBit eoBit.h ga/eoBit.h
\ingroup bitstring @class eoBit eoBit.h ga/eoBit.h
* based on STL's vector<bool> specialization. @ingroup bitstring
Based on STL's vector<bool> specialization.
*/ */
template <class FitT> template <class FitT>
class eoVirus : public eoBit<FitT> class eoVirus : public eoBit<FitT>
@ -53,14 +55,14 @@ public:
using eoBit<FitT>::size; using eoBit<FitT>::size;
/** /** (Default) Constructor
* (Default) Constructor.
* @param size Size of the binary std::string. @param size Size of the binary std::string.
*/ */
eoVirus(unsigned _size = 0, bool _value = false, bool _virValue = false): eoVirus(unsigned _size = 0, bool _value = false, bool _virValue = false):
eoBit<FitT>(_size, _value), virus( _size, _virValue) {} eoBit<FitT>(_size, _value), virus( _size, _virValue) {}
/// My class name. /// My class name
virtual std::string className() const { virtual std::string className() const {
return "eoVirus"; return "eoVirus";
} }
@ -80,9 +82,9 @@ public:
virus[_i ] = _bit; virus[_i ] = _bit;
} }
/** /** To print me on a stream.
* To print me on a stream.
* @param os The ostream. @param os The ostream.
*/ */
virtual void printOn(std::ostream& os) const { virtual void printOn(std::ostream& os) const {
EO<FitT>::printOn(os); EO<FitT>::printOn(os);
@ -93,9 +95,9 @@ public:
std::copy(virus.begin(), virus.end(), std::ostream_iterator<bool>(os)); std::copy(virus.begin(), virus.end(), std::ostream_iterator<bool>(os));
} }
/** /** To read me from a stream.
* To read me from a stream.
* @param is The istream. @param is The istream.
*/ */
virtual void readFrom(std::istream& is){ virtual void readFrom(std::istream& is){
eoBit<FitT>::readFrom(is); eoBit<FitT>::readFrom(is);
@ -109,7 +111,10 @@ public:
std::bind2nd(std::equal_to<char>(), '1')); std::bind2nd(std::equal_to<char>(), '1'));
} }
} }
private: private:
std::vector<bool> virus; std::vector<bool> virus;
}; };
@ -119,6 +124,7 @@ public:
// Local Variables: // Local Variables:
// coding: iso-8859-1
// mode: C++ // mode: C++
// c-file-style: "Stroustrup" // c-file-style: "Stroustrup"
// End: // End:

View file

@ -22,7 +22,7 @@
Marc.Schoenauer@polytechnique.fr Marc.Schoenauer@polytechnique.fr
mak@dhi.dk mak@dhi.dk
CVS Info: $Date: 2004-12-23 15:29:06 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/src/eoVector.h,v 1.16 2004-12-23 15:29:06 kuepper Exp $ $Author: kuepper $ CVS Info: $Date: 2005-10-06 17:22:40 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/src/eoVector.h,v 1.17 2005-10-06 17:22:40 kuepper Exp $ $Author: kuepper $
*/ */
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -31,7 +31,7 @@
#define _eoVector_h #define _eoVector_h
#include <vector> #include <vector>
#include <iterator> // needed for GCC 3.2 #include <iterator>
#include <EO.h> #include <EO.h>
/** /**

View file

@ -39,18 +39,19 @@
#include <functional> // bind2nd #include <functional> // bind2nd
#include <string> // std::string #include <string> // std::string
#include <eoVector.h> #include "eoVector.h"
/** /** @defgroup bitstring
\defgroup bitstring
Various functions for a bitstring representation Various functions for a bitstring representation
*/ */
/** eoBit: implementation of bitstring chromosome. /** Implementation of bitstring chromosome.
\class eoBit eoBit.h ga/eoBit.h
\ingroup bitstring @class eoBit eoBit.h ga/eoBit.h
* based on STL's std::vector<bool> specialization. @ingroup bitstring
Based on STL's std::vector<bool> specialization.
*/ */
template <class FitT> class eoBit: public eoVector<FitT, bool> template <class FitT> class eoBit: public eoVector<FitT, bool>
{ {

View file

@ -63,8 +63,11 @@ t_eofitness_SOURCES = t-eofitness.cpp
t_eoFitnessAssembledEA_SOURCES = t-eoFitnessAssembledEA.cpp t_eoFitnessAssembledEA_SOURCES = t-eoFitnessAssembledEA.cpp
t_eobin_SOURCES = t-eobin.cpp t_eobin_SOURCES = t-eobin.cpp
t_eoVirus_SOURCES = t-eoVirus.cpp t_eoVirus_SOURCES = t-eoVirus.cpp
t_MGE1bit_CXXFLAGS = -I$(top_srcdir)/contrib/MGE
t_MGE1bit_SOURCES = t-MGE1bit.cpp t_MGE1bit_SOURCES = t-MGE1bit.cpp
t_MGE_CXXFLAGS = -I$(top_srcdir)/contrib/MGE
t_MGE_SOURCES = t-MGE.cpp t_MGE_SOURCES = t-MGE.cpp
t_MGE_control_CXXFLAGS = -I$(top_srcdir)/contrib/MGE
t_MGE_control_SOURCES = t-MGE-control.cpp t_MGE_control_SOURCES = t-MGE-control.cpp
t_eoStateAndParser_SOURCES = t-eoStateAndParser.cpp t_eoStateAndParser_SOURCES = t-eoStateAndParser.cpp
t_eoCheckpointing_SOURCES = t-eoCheckpointing.cpp t_eoCheckpointing_SOURCES = t-eoCheckpointing.cpp

View file

@ -2,20 +2,24 @@
// t-eoMGE.cpp // t-eoMGE.cpp
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef __GNUG__ #ifndef __GNUG__
// to avoid long name warnings // to avoid long name warnings
#pragma warning(disable:4786) #pragma warning(disable:4786)
#endif // __GNUG__ #endif // __GNUG__
#include <eo> #include "eo"
#include <ga/eoBitOp.h> #include "ga/eoBitOp.h"
#include "RoyalRoad.h" #include "RoyalRoad.h"
// Viri // Viri
#include "../contrib/MGE/VirusOp.h" #include "VirusOp.h"
#include "../contrib/MGE/eoVirus.h" #include "eoVirus.h"
#include "../contrib/MGE/eoInitVirus.h" #include "eoInitVirus.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View file

@ -2,6 +2,10 @@
// t-eoMGE.cpp // t-eoMGE.cpp
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef __GNUG__ #ifndef __GNUG__
// to avoid long name warnings // to avoid long name warnings
#pragma warning(disable:4786) #pragma warning(disable:4786)
@ -13,9 +17,9 @@
#include "RoyalRoad.h" #include "RoyalRoad.h"
// Viri // Viri
#include "../contrib/MGE/VirusOp.h" #include "VirusOp.h"
#include "../contrib/MGE/eoVirus.h" #include "eoVirus.h"
#include "../contrib/MGE/eoInitVirus.h" #include "eoInitVirus.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View file

@ -2,20 +2,23 @@
// t-eoMGE.cpp // t-eoMGE.cpp
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef __GNUG__ #ifndef __GNUG__
// to avoid long name warnings // to avoid long name warnings
#pragma warning(disable:4786) #pragma warning(disable:4786)
#endif // __GNUG__ #endif // __GNUG__
#include <eo> #include "eo"
#include <ga/eoBitOp.h> #include "ga/eoBitOp.h"
#include "RoyalRoad.h" #include "RoyalRoad.h"
// Viri // Viri
#include "../contrib/MGE/VirusOp.h" #include "VirusOp.h"
#include "../contrib/MGE/eoVirus.h" #include "eoVirus.h"
#include "../contrib/MGE/eoInitVirus.h" #include "eoInitVirus.h"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------