Removed "using namespace std" statements from header files in EO -- "std::" identifier were added where necessary.
This commit is contained in:
parent
6441ea1ec3
commit
86fa476c67
263 changed files with 2009 additions and 1976 deletions
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
Contact: todos@geneura.ugr.es, http://geneura.ugr.es
|
||||
Marc.Schoenauer@polytechnique.fr
|
||||
CVS Info: $Date: 2001-12-03 16:28:30 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/contrib/MGE/VirusOp.h,v 1.2 2001-12-03 16:28:30 evomarc Exp $ $Author: evomarc $
|
||||
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 $
|
||||
*/
|
||||
|
||||
#ifndef VirusOp_h
|
||||
|
|
@ -28,7 +28,7 @@ CVS Info: $Date: 2001-12-03 16:28:30 $ $Header: /home/nojhan/dev/eodev/eodev_cvs
|
|||
|
||||
#include <iostream> // ostream, istream
|
||||
#include <functional> // bind2nd
|
||||
#include <string> // string
|
||||
#include <string> // std::string
|
||||
|
||||
#include <utils/eoRNG.h>
|
||||
#include "../contrib/MGE/eoVirus.h"
|
||||
|
|
@ -40,7 +40,7 @@ template<class FitT>
|
|||
class VirusBitFlip: public eoMonOp<eoVirus<FitT> > {
|
||||
public:
|
||||
/// The class name.
|
||||
virtual string className() const { return "VirusBitFlip"; };
|
||||
virtual std::string className() const { return "VirusBitFlip"; };
|
||||
|
||||
/**
|
||||
* Change one bit.
|
||||
|
|
@ -57,7 +57,7 @@ template<class FitT>
|
|||
class VirusMutation: public eoMonOp<eoVirus<FitT> > {
|
||||
public:
|
||||
/// The class name.
|
||||
virtual string className() const { return "VirusMutation"; };
|
||||
virtual std::string className() const { return "VirusMutation"; };
|
||||
|
||||
/**
|
||||
* Change one bit.
|
||||
|
|
@ -65,7 +65,7 @@ class VirusMutation: public eoMonOp<eoVirus<FitT> > {
|
|||
*/
|
||||
bool operator()(eoVirus<FitT>& _chrom) {
|
||||
// Search for virus bits
|
||||
vector<unsigned> bitsSet;
|
||||
std::vector<unsigned> bitsSet;
|
||||
for ( unsigned i = 0; i < _chrom.size(); i ++ ) {
|
||||
if ( _chrom.virusBit(i) ) {
|
||||
bitsSet.push_back( i );
|
||||
|
|
@ -90,7 +90,7 @@ class VirusShiftMutation: public eoMonOp<eoVirus<FitT> > {
|
|||
VirusShiftMutation( ) {};
|
||||
|
||||
/// The class name.
|
||||
virtual string className() const { return "VirusShiftMutation"; };
|
||||
virtual std::string className() const { return "VirusShiftMutation"; };
|
||||
|
||||
/**
|
||||
* Change one bit.
|
||||
|
|
@ -125,7 +125,7 @@ template<class FitT>
|
|||
class VirusTransmission: public eoBinOp<eoVirus<FitT> > {
|
||||
public:
|
||||
/// The class name.
|
||||
virtual string className() const { return "VirusTransmission"; };
|
||||
virtual std::string className() const { return "VirusTransmission"; };
|
||||
|
||||
/**
|
||||
* Change one bit.
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
Contact: todos@geneura.ugr.es, http://geneura.ugr.es
|
||||
Marc.Schoenauer@polytechnique.fr
|
||||
CVS Info: $Date: 2001-05-17 10:08:25 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/contrib/MGE/eoVirus.h,v 1.1 2001-05-17 10:08:25 jmerelo Exp $ $Author: jmerelo $
|
||||
CVS Info: $Date: 2003-02-27 19:26:44 $ $Header: /home/nojhan/dev/eodev/eodev_cvs/eo/contrib/MGE/eoVirus.h,v 1.2 2003-02-27 19:26:44 okoenig Exp $ $Author: okoenig $
|
||||
*/
|
||||
|
||||
#ifndef eoVirus_h
|
||||
|
|
@ -28,7 +28,7 @@ CVS Info: $Date: 2001-05-17 10:08:25 $ $Header: /home/nojhan/dev/eodev/eodev_cvs
|
|||
|
||||
#include <iostream> // ostream, istream
|
||||
#include <functional> // bind2nd
|
||||
#include <string> // string
|
||||
#include <string> // std::string
|
||||
|
||||
#include <ga/eoBit.h>
|
||||
|
||||
|
|
@ -49,13 +49,13 @@ template <class FitT> class eoVirus: public eoBit<FitT>
|
|||
|
||||
/**
|
||||
* (Default) Constructor.
|
||||
* @param size Size of the binary string.
|
||||
* @param size Size of the binary std::string.
|
||||
*/
|
||||
eoVirus(unsigned _size = 0, bool _value = false, bool _virValue = false):
|
||||
eoBit<FitT>(_size, _value), virus( _size, _virValue) {}
|
||||
|
||||
/// My class name.
|
||||
virtual string className() const {
|
||||
virtual std::string className() const {
|
||||
return "eoVirus";
|
||||
}
|
||||
|
||||
|
|
@ -78,33 +78,33 @@ template <class FitT> class eoVirus: public eoBit<FitT>
|
|||
* To print me on a stream.
|
||||
* @param os The ostream.
|
||||
*/
|
||||
virtual void printOn(ostream& os) const {
|
||||
virtual void printOn(std::ostream& os) const {
|
||||
EO<FitT>::printOn(os);
|
||||
os << ' ';
|
||||
os << size() << ' ';
|
||||
copy(begin(), end(), ostream_iterator<bool>(os));
|
||||
cout << endl;
|
||||
copy(virus.begin(), virus.end(), ostream_iterator<bool>(os));
|
||||
std::copy(begin(), end(), std::ostream_iterator<bool>(os));
|
||||
std::cout << std::endl;
|
||||
std::copy(virus.begin(), virus.end(), std::ostream_iterator<bool>(os));
|
||||
}
|
||||
|
||||
/**
|
||||
* To read me from a stream.
|
||||
* @param is The istream.
|
||||
*/
|
||||
virtual void readFrom(istream& is){
|
||||
virtual void readFrom(std::istream& is){
|
||||
eoBit<FitT>::readFrom(is);
|
||||
unsigned s;
|
||||
is >> s;
|
||||
string bits;
|
||||
std::string bits;
|
||||
is >> bits;
|
||||
if (is) {
|
||||
virus.resize(bits.size());
|
||||
transform(bits.begin(), bits.end(), virus.begin(),
|
||||
bind2nd(equal_to<char>(), '1'));
|
||||
std::transform(bits.begin(), bits.end(), virus.begin(),
|
||||
std::bind2nd(std::equal_to<char>(), '1'));
|
||||
}
|
||||
}
|
||||
private:
|
||||
vector<bool> virus;
|
||||
std::vector<bool> virus;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <iostream> // istream, ostream
|
||||
#include <string> // para string
|
||||
#include <std::string> // para std::string
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ class eoAged: public Object
|
|||
it's got code as an example of implementation. Only "leaf" classes
|
||||
can be non-virtual.
|
||||
*/
|
||||
virtual string className() const { return string("eoAged")+Object::className(); };
|
||||
virtual std::string className() const { return std::string("eoAged")+Object::className(); };
|
||||
|
||||
/**
|
||||
* Read object.
|
||||
|
|
|
|||
Reference in a new issue