correction of the parallel transformation

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@745 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
canape 2007-10-25 13:44:57 +00:00
commit 4d885cc29a
2 changed files with 19 additions and 6 deletions

View file

@ -43,7 +43,14 @@
template <class F, class T> void pack (const eoVector <F, T> & __v) {
pack (__v.fitness ()) ;
if ( !__v.invalid() )
{
pack( (unsigned int) 1 );
pack (__v.fitness ()) ;
}
else
pack( (unsigned int) 0 );
unsigned len = __v.size ();
pack (len);
for (unsigned i = 0 ; i < len; i ++)
@ -53,9 +60,15 @@ template <class F, class T> void pack (const eoVector <F, T> & __v) {
template <class F, class T> void unpack (eoVector <F, T> & __v) {
F fit;
unpack (fit);
__v.fitness (fit);
unsigned int vfit;
unpack( vfit );
if ( vfit )
{
unpack (fit);
__v.fitness (fit);
}
else
__v.invalidate();
unsigned len;
unpack (len);
__v.resize (len);

View file

@ -149,8 +149,8 @@ template< class EOT > void peoParaSGATransform< EOT > :: unpackResult() {
:: unpack( pop->operator[]( sidx++ ) );
:: unpack( pop->operator[]( sidx ) );
num_term += 2;
if( num_term == pop->size() ) {
// Can be used with a odd size
if( num_term == 2*(pop->size()/2) ) {
getOwner()->setActive();
resume();