git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2226 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
fbd546906b
commit
bc0d60e20a
1 changed files with 8 additions and 9 deletions
|
|
@ -105,21 +105,20 @@ public:
|
||||||
*@param _size the vector size
|
*@param _size the vector size
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virtual inline __host__ void setSize(unsigned _size) {
|
void setSize(unsigned _size) {
|
||||||
|
|
||||||
if(_size<N) {
|
if (_size < N) {
|
||||||
moGPUBitVector<Fitness> tmp_vect(_size);
|
moGPUBitVector<Fitness> tmp_vect(_size);
|
||||||
for (unsigned i = 0; i < tmp_vect.N; i++)
|
for (unsigned i = 0; i < tmp_vect.N; i++)
|
||||||
tmp_vect.vect[i]= vect[i];
|
tmp_vect.vect[i] = vect[i];
|
||||||
(tmp_vect).invalidate();
|
(tmp_vect).invalidate();
|
||||||
(*this)=tmp_vect;
|
(*this) = tmp_vect;
|
||||||
}
|
} else if (_size > N) {
|
||||||
else if(_size>N) {
|
|
||||||
moGPUBitVector<Fitness> tmp_vect(_size);
|
moGPUBitVector<Fitness> tmp_vect(_size);
|
||||||
for (unsigned i = 0; i <N; i++)
|
for (unsigned i = 0; i < N; i++)
|
||||||
tmp_vect.vect[i]= vect[i];
|
tmp_vect.vect[i] = vect[i];
|
||||||
(tmp_vect).invalidate();
|
(tmp_vect).invalidate();
|
||||||
(*this)=tmp_vect;
|
(*this) = tmp_vect;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue