Function vector_shuffle

O2scl : Function List

template<class vec_t, class data_t>
void o2scl::vector_shuffle(rng<> &r, size_t n, vec_t &data)

Shuffle the first n elements of vector data.

Note

This function is based on the GSL function gsl_ran_shuffle() in randist/shuffle.c.

Note

This function works only on vector types which guarantee adjacent storage, such as vector<double>.

Note

If n is 0, this function silently does nothing.