template<typename T>
class open3d::utility::random::DiscreteGenerator< T >
Generate discretely distributed integer values according to a range of weight values. This class is globally seeded by utility::random::Seed(). This class is a wrapper around std::discrete_distribution.
Example:
std::vector<double> weights{1, 2, 3, 4, 5};
utility::random::DiscreteGenerator<size_t> gen(weights.cbegin(),
weights.cend()); for (size_t i = 0; i < 10; i++) {
std::cout << gen() << std::endl;
}
void Seed(const int seed)
Set Open3D global random seed.
Definition: Random.cpp:53