diff --git a/branches/ParadisEO-GPU/src/GPUType/moGPUVector.h b/branches/ParadisEO-GPU/src/GPUType/moGPUVector.h index 55ef2fa6e..64be706fb 100644 --- a/branches/ParadisEO-GPU/src/GPUType/moGPUVector.h +++ b/branches/ParadisEO-GPU/src/GPUType/moGPUVector.h @@ -73,30 +73,30 @@ template } /** - *Copy Constructor - *@param _vector The vector passed to the function to determine the new content. - */ + *Copy Constructor + *@param _vector The vector passed to the function to determine the new content. + */ - moGPUVector(const moGPUVector & _vector) { + moGPUVector(const moGPUVector & _vector) { - N = _vector.N; - vect = new ElemType[N]; - for (unsigned i = 0; i < N; i++) - vect[i] = _vector.vect[i]; - if (!(_vector.invalid())) - fitness(_vector.fitness()); - else - (*this).invalidate(); - } + N = _vector.N; + vect = new ElemType[N]; + for (unsigned i = 0; i < N; i++) + vect[i] = _vector.vect[i]; + if (!(_vector.invalid())) + fitness(_vector.fitness()); + else + (*this).invalidate(); + } - /** - * Destructor. - */ + /** + * Destructor. + */ - ~moGPUVector() { - if (N >= 1) - delete[] vect; - } + ~moGPUVector() { + if (N >= 1) + delete[] vect; + } /** *How to fill the solution vector. @@ -104,28 +104,28 @@ template virtual void create() =0; - /** - *Assignment operator - *@param _vector The vector passed to the function to determine the new content. - *@return a new vector. - */ + /** + *Assignment operator + *@param _vector The vector passed to the function to determine the new content. + *@return a new vector. + */ - moGPUVector& operator=(const moGPUVector & _vector) { + moGPUVector& operator=(const moGPUVector & _vector) { - if (!(N == _vector.N)) { - delete[] vect; - N = _vector.N; - vect = new ElemType[N]; - } - for (unsigned i = 0; i < N; i++) - vect[i] = _vector.vect[i]; - if (!(_vector.invalid())) - fitness(_vector.fitness()); - else - (*this).invalidate(); - return (*this); + if (!(N == _vector.N)) { + delete[] vect; + N = _vector.N; + vect = new ElemType[N]; + } + for (unsigned i = 0; i < N; i++) + vect[i] = _vector.vect[i]; + if (!(_vector.invalid())) + fitness(_vector.fitness()); + else + (*this).invalidate(); + return (*this); - } + } /** *An accessor read only on the i'th element of the vector (function inline can be called from host or device). @@ -134,9 +134,9 @@ template */ inline __host__ __device__ const ElemType & operator[](unsigned _i) const { - if(_i */ inline __host__ __device__ ElemType & operator[](unsigned _i) { - if(_i inline __host__ __device__ unsigned size() { - return N; + return N; } @@ -165,7 +165,7 @@ template *@param _size the vector size */ - virtual inline __host__ void setSize(unsigned _size)=0; + virtual void setSize(unsigned _size)=0; /** * Write object. Called printOn since it prints the object _on_ a stream.