Electroneum
epee::math_helper Namespace Reference

Classes

class  average
 
class  once_a_time
 
class  once_a_time_milliseconds
 
class  once_a_time_seconds
 
class  speed
 

Functions

template<class tlist >
void randomize_list (tlist &t_list)
 

Function Documentation

◆ randomize_list()

template<class tlist >
void epee::math_helper::randomize_list ( tlist &  t_list)

Definition at line 219 of file math_helper.h.

220  {
221  for(typename tlist::iterator it = t_list.begin();it!=t_list.end();it++)
222  {
223  size_t offset = rand()%t_list.size();
224  typename tlist::iterator it_2 = t_list.begin();
225  for(size_t local_offset = 0;local_offset!=offset;local_offset++)
226  it_2++;
227  if(it_2 == it)
228  continue;
229  std::swap(*it_2, *it);
230  }
231 
232  }
void rand(size_t N, uint8_t *bytes)
Definition: crypto.h:209
Here is the call graph for this function: