31 #ifndef RTABMAP_FLANN_RANDOM_H 32 #define RTABMAP_FLANN_RANDOM_H 64 return low + ((high-low) * (std::rand() / (RAND_MAX + 1.0)));
73 inline int rand_int(
int high = RAND_MAX,
int low = 0)
75 return low + (int) (
double(high-low) * (std::rand() / (RAND_MAX + 1.0)));
117 for (
int i = 0; i < size_; ++i) vals_[i] = i;
120 std::random_shuffle(vals_.begin(), vals_.end(), generator);
132 if (counter_ == size_) {
136 return vals_[counter_++];
143 #endif //FLANN_RANDOM_H
void seed_random(unsigned int seed)
int rand_int(int high=RAND_MAX, int low=0)
double rand_double(double high=1.0, double low=0)
ptrdiff_t operator()(ptrdiff_t i)