Changeset 259 for trunk/src/vector.cc
- Timestamp:
- Mar 4, 2005, 2:09:55 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/vector.cc
r257 r259 2 2 3 3 #include "vector.h" 4 #include "random_singleton.h"5 4 6 5 #include <iostream> … … 170 169 171 170 172 void vector::shuffle(void) const173 {174 vector vec(*this);175 theplu::cpptools::random_singleton*176 rnd=theplu::cpptools::random_singleton::get_instance();177 for (size_t i=0; i<vec.size(); i++){178 size_t index = rnd->get_uniform_int(vec.size()-i);179 gsl_vector_set(v_,i,vec(index));180 vec(index)=vec(vec.size()-i-1);181 }182 }183 184 171 double vector::sum(void) const 185 172 {
Note: See TracChangeset
for help on using the changeset viewer.