diff --git a/branches/ParadisEO-GPU/src/GPUType/moGPUBitVector.h b/branches/ParadisEO-GPU/src/GPUType/moGPUBitVector.h index 5a6066c88..0aad7cb0e 100644 --- a/branches/ParadisEO-GPU/src/GPUType/moGPUBitVector.h +++ b/branches/ParadisEO-GPU/src/GPUType/moGPUBitVector.h @@ -47,6 +47,7 @@ template class moGPUBitVector: public moGPUVector { public: + /** * Define bool vector corresponding to Solution **/ @@ -94,11 +95,35 @@ public: for (unsigned i = 0; i < N; i++) { - vect[i] = (bool) round((float) rng.rand() / RAND_MAX); + vect[i] = (int) (rng.rand() / RAND_MAX); } } + /** + *Function inline to set the size of vector, called from host. + *@param _size the vector size + */ + + virtual inline __host__ void setSize(unsigned _size) { + + if(_size tmp_vect(_size); + for (unsigned i = 0; i < tmp_vect.N; i++) + tmp_vect.vect[i]= vect[i]; + (tmp_vect).invalidate(); + (*this)=tmp_vect; + } + else if(_size>N) { + moGPUBitVector tmp_vect(_size); + for (unsigned i = 0; i