int handler::sample_next(uchar *buf) {
  // Temporary set inited to RND, since we are calling rnd_next().
  int res = rnd_next(buf);

  std::uniform_real_distribution<double> rnd(0.0, 1.0);
  while (!res && rnd(m_random_number_engine) > (m_sampling_percentage / 100.0))
    res = rnd_next(buf);

  return res;
}

 

相关文章:

  • 2021-12-07
  • 2021-07-19
  • 2021-11-30
  • 2021-09-21
  • 2021-11-02
  • 2021-12-26
猜你喜欢
  • 2021-07-03
  • 2022-01-05
  • 2021-10-05
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案