21 size_t p_size,
size_t p_pick, std::vector<size_t>& p_ind)
25 std::vector<size_t> a(p_size);
26 for (
size_t i = 0; i < p_size; i++) a[i] = i;
30 for (
size_t i = 0; i < p_pick; i++) p_ind[i] = a[i];
37 std::set<size_t> p_set,
size_t p_pick, std::vector<size_t>& p_ind)
40 std::vector<size_t> inds(p_set.begin(), p_set.end());
44 for (
size_t i = 0; i < p_pick; i++) p_ind[i] = inds[i];
void shuffle(RandomIt first, RandomIt last, URBG &&g)
Uniform shuffle a sequence.
#define ASSERT_(f)
Defines an assertion mechanism.
This base provides a set of functions for maths stuff.
void pickRandomIndex(size_t p_size, size_t p_pick, std::vector< size_t > &p_ind)
Select random (unique) indices from the 0..p_size sequence.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.