Added the calls to base class I/O routines in printOn and readFrom
This commit is contained in:
parent
b0b0a3f9da
commit
9cc1cfd1b4
1 changed files with 14 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
eoBin.h
|
eoBin.h
|
||||||
(c) GeNeura Team 1998
|
(c) GeNeura Team 1998, 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 it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
|
@ -17,6 +17,13 @@
|
||||||
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
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* MS, Nov. 23, 2000
|
||||||
|
Added the calls to base class I/O routines that print the fitness
|
||||||
|
Left printing/reading of the size of the bitstring,
|
||||||
|
for backward compatibility, and as it is a general practice in EO
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef eoBin_h
|
#ifndef eoBin_h
|
||||||
|
|
@ -64,6 +71,8 @@ template <class F> class eoBin: public eoFixedLength<F, bool>
|
||||||
*/
|
*/
|
||||||
void printOn(ostream& os) const
|
void printOn(ostream& os) const
|
||||||
{
|
{
|
||||||
|
EO<F>::printOn(os);
|
||||||
|
os << ' ';
|
||||||
os << size() << ' ';
|
os << size() << ' ';
|
||||||
copy(begin(), end(), ostream_iterator<bool>(os));
|
copy(begin(), end(), ostream_iterator<bool>(os));
|
||||||
}
|
}
|
||||||
|
|
@ -74,6 +83,9 @@ template <class F> class eoBin: public eoFixedLength<F, bool>
|
||||||
*/
|
*/
|
||||||
void readFrom(istream& is)
|
void readFrom(istream& is)
|
||||||
{
|
{
|
||||||
|
EO<F>::readFrom(is);
|
||||||
|
unsigned s;
|
||||||
|
is >> s;
|
||||||
string bits;
|
string bits;
|
||||||
is >> bits;
|
is >> bits;
|
||||||
if (is)
|
if (is)
|
||||||
|
|
|
||||||
Reference in a new issue