- Main Page
- Classes
- Files

- Search for |

# mix.h

    00001
    00002
    00003 /*
    00004    file: 'mix.h'
    00005    author: S. CAHON
    00006    mail: paradiseo-help@lists.gforge.inria.fr
    00007    date: dec. 2005
    00008 */
    00009
    00010 #ifndef __mix_h
    00011 #define __mix_h
    00012
    00013 #include <vector>
    00014
    00015 #include <utils/eoRNG.h>
    00016
    00017 template <class T> void mix (std :: vector <T> & __v) {
    00018
    00019   unsigned len = __v.size () ;
    00020
    00021   for (unsigned i = 0 ; i < len ; i ++)
    00022     std :: swap (__v [i], __v [rng.random (len)]) ;
    00023 }
    00024
    00025 #endif