tree modifications
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@512 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
0d2b55437a
commit
61c0424eed
47 changed files with 395 additions and 458 deletions
25
trunk/paradiseo-mo/tutorial/examples/tsp/mix.h
Normal file
25
trunk/paradiseo-mo/tutorial/examples/tsp/mix.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "mix.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003-2006
|
||||
|
||||
/* LICENCE TEXT
|
||||
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*/
|
||||
|
||||
#ifndef mix_h
|
||||
#define mix_h
|
||||
|
||||
#include <utils/eoRNG.h>
|
||||
|
||||
template <class T> void mix (std :: vector <T> & __vect)
|
||||
{
|
||||
for (unsigned int i = 0 ; i < __vect.size () ; i ++)
|
||||
{
|
||||
std :: swap (__vect [i], __vect [rng.random (__vect.size ())]) ;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue