new style peo

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1021 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
canape 2008-02-29 14:08:59 +00:00
commit edb6d65a7b
34 changed files with 407 additions and 386 deletions

View file

@ -39,29 +39,29 @@
#include <peo>
struct Algorithm
{
void operator()(double & _d)
{
_d = _d * _d;
}
};
struct Algorithm
{
void operator()(double & _d)
{
_d = _d * _d;
}
};
int main (int __argc, char * * __argv)
{
peo :: init (__argc, __argv);
if (getNodeRank()==1)
std::cout<<"\n\nTest : multistart\n\n";
std::cout<<"\n\nTest : multistart\n\n";
std::vector < double > v;
if (getNodeRank()==1)
std::cout<<"\n\nBefore :";
for(unsigned i = 0; i< 10; i++)
{
v.push_back(i);
if (getNodeRank()==1)
std::cout<<"\n"<<v[i];
}
std::cout<<"\n\nBefore :";
for (unsigned i = 0; i< 10; i++)
{
v.push_back(i);
if (getNodeRank()==1)
std::cout<<"\n"<<v[i];
}
Algorithm algo;
peoMultiStart < double > initParallel (algo);
peoWrapper parallelAlgo (initParallel, v);
@ -69,9 +69,9 @@ int main (int __argc, char * * __argv)
peo :: run( );
peo :: finalize( );
if (getNodeRank()==1)
{
std::cout<<"\n\nAfter :\n";
for(unsigned i = 0; i< 10; i++)
std::cout<<v[i]<<"\n";
}
{
std::cout<<"\n\nAfter :\n";
for (unsigned i = 0; i< 10; i++)
std::cout<<v[i]<<"\n";
}
}