Optimized code (Plymorphism)
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2190 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
af629ba190
commit
959962bdcd
1 changed files with 67 additions and 73 deletions
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
ParadisEO WebSite : http://paradiseo.gforge.inria.fr
|
||||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _moCudaBitVector_H_
|
#ifndef _moCudaBitVector_H_
|
||||||
#define _moCudaBitVector_H_
|
#define _moCudaBitVector_H_
|
||||||
|
|
@ -45,7 +45,7 @@ template<class Fitness>
|
||||||
|
|
||||||
class moCudaBitVector: public moCudaVector<bool, Fitness> {
|
class moCudaBitVector: public moCudaVector<bool, Fitness> {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
using moCudaVector<bool, Fitness>::vect;
|
using moCudaVector<bool, Fitness>::vect;
|
||||||
using moCudaVector<bool, Fitness>::N;
|
using moCudaVector<bool, Fitness>::N;
|
||||||
|
|
@ -64,12 +64,8 @@ class moCudaBitVector: public moCudaVector<bool, Fitness> {
|
||||||
*@param _size The neighborhood size.
|
*@param _size The neighborhood size.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
moCudaBitVector(unsigned _size) {
|
moCudaBitVector(unsigned _size) :
|
||||||
|
moCudaVector<bool, Fitness> (_size) {
|
||||||
N = _size;
|
|
||||||
|
|
||||||
vect = new bool[_size];
|
|
||||||
|
|
||||||
create();
|
create();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -81,9 +77,7 @@ class moCudaBitVector: public moCudaVector<bool, Fitness> {
|
||||||
|
|
||||||
moCudaBitVector(unsigned _size, bool _b) {
|
moCudaBitVector(unsigned _size, bool _b) {
|
||||||
|
|
||||||
N = _size;
|
moCudaVector<bool, Fitness>:: moCudaVector(_size);
|
||||||
|
|
||||||
vect = new bool[_size];
|
|
||||||
|
|
||||||
for (unsigned i = 0; i < _size; i++)
|
for (unsigned i = 0; i < _size; i++)
|
||||||
vect[i] = _b;
|
vect[i] = _b;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue