Function vector_shuffle¶
-
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 vectordata
.Note
This function is based on the GSL function
gsl_ran_shuffle()
inrandist/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.