added new tutorial dir
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@467 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
7aaffed845
commit
71169cf7f0
61 changed files with 3459 additions and 0 deletions
25
trunk/paradiseo-peo/tutorial/examples/tsp/src/mix.h
Normal file
25
trunk/paradiseo-peo/tutorial/examples/tsp/src/mix.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
|
||||
/*
|
||||
file: 'mix.h'
|
||||
author: S. CAHON
|
||||
mail: paradiseo-help@lists.gforge.inria.fr
|
||||
date: dec. 2005
|
||||
*/
|
||||
|
||||
#ifndef __mix_h
|
||||
#define __mix_h
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <utils/eoRNG.h>
|
||||
|
||||
template <class T> void mix (std :: vector <T> & __v) {
|
||||
|
||||
unsigned len = __v.size () ;
|
||||
|
||||
for (unsigned i = 0 ; i < len ; i ++)
|
||||
std :: swap (__v [i], __v [rng.random (len)]) ;
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue