Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1.     int M = config_.resample_rate * samples.size(), N = samples.size();
  2.    
  3.     if(config_.resample_strategy == MWEAKEST) {
  4.      
  5.       auto cmp = [](SamplePtr a, SamplePtr b) { return a->weight() < b->weight(); };
  6.       sort( samples.begin(), samples.end(), cmp);
  7.      
  8.       for(int i = 0, k = N - 1; i < std::min(M, N/2); i++, k--) {
  9.     samples[i] = std::make_shared<Sample> ( *samples[k] );
  10.     normal ( samples[i], *samples[i], config_.sigma_static_position*dt, config_.sigma_static_orientation*dt );
  11.       }
  12.      
  13.      
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement