new style peo
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1021 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
ef8ef3f3b2
commit
edb6d65a7b
34 changed files with 407 additions and 386 deletions
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue