util.hpp
// fill a vector with random values by following the normal distribution
fill a vector with random values by following the normal distribution
fill a vector with random values by following the normal distribution
static void gen_normaldist_vector(vector<double> *vec, const double avg, const double sd){
  mt19937 mt{random_device{}()};
  normal_distribution<> dist(avg, sd);
  int size = (*vec).size();
  vector<double>::iterator it = vec->begin(), end = vec->end();
  for(int i=0; i<size; ++i){
    *(it+i) = dist(mt);
  }
}
static void gen_normaldist_vector ( vector < double > * vec , const double avg , const double sd ) { mt19937 mt { random_device { } ( ) } ; normal_distribution < > dist ( avg , sd ) ; int size = ( * vec ) . size ( ) ; vector < double > :: iterator it = vec -> begin ( ) , end = vec -> end ( ) ; for ( int i = 0 ; i < size ; ++ i ) { * ( it + i ) = dist ( mt ) ; } }
fill a vector with random values by following the normal distribution
fill a vector with random values by following the normal distribution