git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2153 331e1502-861f-0410-8da2-ba01fb791d7f

This commit is contained in:
boufaras 2011-02-10 13:57:17 +00:00
commit 8e9fbc85ce

View file

@ -1,8 +1,8 @@
/* /*
<t-moCudaBitNeighbor.cu> <t-moCudaBitNeighbor.cu>
Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010 Copyright (C) DOLPHIN Project-Team, INRIA Lille - Nord Europe, 2006-2010
Thé Van LUONG, Karima Boufaras Karima Boufaras, Thé Van LUONG
This software is governed by the CeCILL license under French law and This software is governed by the CeCILL license under French law and
abiding by the rules of distribution of free software. You can use, abiding by the rules of distribution of free software. You can use,
@ -30,42 +30,42 @@
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
*/ */
#include <cstdlib> #include <cstdlib>
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>
#include <cudaType/moCudaBitVector.h> #include <cudaType/moCudaBitVector.h>
#include <neighborhood/moCudaBitNeighbor.h> #include <neighborhood/moCudaBitNeighbor.h>
typedef moCudaBitVector<eoMaximizingFitness> Solution; typedef moCudaBitVector<eoMaximizingFitness> Solution;
typedef moCudaBitNeighbor<Solution,eoMaximizingFitness> Neighbor; typedef moCudaBitNeighbor<Solution,eoMaximizingFitness> Neighbor;
int main() { int main() {
std::cout << "[t-moCudaBitNeighbor] => START" << std::endl; std::cout << "[t-moCudaBitNeighbor] => START" << std::endl;
//test constructor //test constructor
Neighbor test1, test2; Neighbor test1, test2;
test1.fitness(3); test1.fitness(3);
//test operateur d'affectation //test operateur d'affectation
test2=test1; test2=test1;
assert(test1.fitness()==test2.fitness()); assert(test1.fitness()==test2.fitness());
//test operateur de copy //test operateur de copy
Neighbor test3(test1); Neighbor test3(test1);
assert(test1.fitness()==test3.fitness()); assert(test1.fitness()==test3.fitness());
test1.printOn(std::cout); test1.printOn(std::cout);
test2.printOn(std::cout); test2.printOn(std::cout);
test3.printOn(std::cout); test3.printOn(std::cout);
assert(test1.className()=="moCudaBitNeighbor"); assert(test1.className()=="moCudaBitNeighbor");
std::cout << "[t-moCudaBitNeighbor] => OK" << std::endl; std::cout << "[t-moCudaBitNeighbor] => OK" << std::endl;
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }